In the Shadows - rogue-ish prototype (visibility engine)

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I have now found a computer for debugging this. The game won't run and it's got a ATI-card. Also I get the atioglxx errors inside the designer. I will setup the debugging environment and hopefully find a solution to the problem in the following days. Maybe the next computer I buy should have a ATI-card just so I won't accidentally introduce non-ATI compatible OpenGL calls in the future.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Cool Ville, I was going to suggest a donation box to help get you an ATI laptop or something,. . Hopefully you can fix it as quite a few ppl seem to have these machines. Thanks again for your efforts :)

I have done a tinny bit more on the game,.
- added some niffty smooth scrolling, much nicer to play now.
- the monsters now take shots at you if you move too close., (I need to add an effect to show shot directions.)
- tweeked the graphics and the sounds, a bit.
- Control Key now lets the monsters move while the player is still (a wait key).

This was going to just be a simple and quick little game, however it seems to hold some potential so perhaps I will re-work it a bit more, to add a proper timing system,. and improve/expand the wandering monster AI,. etc.

I am still just testing the basic systems that I think are needed to do the simple game I have in mind.
Attachments
InTheShadows_023.zip
.exe (fullscreen)
(38.95 KiB) Downloaded 671 times
iterationGAMES.com
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,

Since you've added inertia to the camera, my previous suggestion of only rendering when the screen needs to be updated becomes pretty much obsolete. Something else you can do to dramatically increase performance is to render your maze in a texture instead of using a individual sprite for each cell.

For example ...

Code: Select all

ZZDC<?xml version="1.0" encoding="iso-8859-1" ?>
<Model Name="Model">
  <Definitions>
    <DefineArray Name="Grid" Type="1" Dimensions="1" SizeDim1="32" SizeDim2="32"/>
    <Mesh Name="Mesh">
      <Producers>
        <MeshBox Scale="0.5 0.5 1" Grid2DOnly="255"/>
        <MeshExpression>
          <Expression>
<![CDATA[// Since TexCoords cannot be set, move the vertices instead.

this.V.X += 0.5;
this.V.Y += 0.5;]]>
          </Expression>
        </MeshExpression>
      </Producers>
    </Mesh>
    <Material Name="Material" Texture="TileBitmap" Texture2="GridBitmap" TextureScale="32 32 1" TextureWrapMode="1"/>
    <Bitmap Name="TileBitmap" Width="0" Height="0" Filter="2">
      <Producers>
        <BitmapCells PointsPlacement="1" UsedMetrics="2" RandomSeed="2" BorderPixels="0" PointCount="4"/>
      </Producers>
    </Bitmap>
    <Bitmap Name="GridBitmap" Width="1" Height="1" Filter="1">
      <Producers>
        <BitmapExpression>
          <Expression>
<![CDATA[//

int U = X*32;
int V = Y*32;

// Use light values instead

if(Grid[U,V] != 0)this.Pixel = 1;]]>
          </Expression>
        </BitmapExpression>
      </Producers>
    </Bitmap>
  </Definitions>
  <OnRender>
    <ZExpression Comment="This shouldn&apos;t be in OnRender, just for testing">
      <Expression>
<![CDATA[// Empty the grid

for(int U=0; U<Grid.SizeDim1; ++U)
{
  for(int V=0; V<Grid.SizeDim2; ++V)
  {
    Grid[U,V] = 0;
  }
}

// Some bogus data

for(int I=0; I<Grid.SizeDim2; ++I)
{
  Grid[I,0] = 1; Grid[I,31] = 1; 
  Grid[0,I] = 1; Grid[31,I] = 1;
}

Grid[15,13] = 1;
Grid[15,15] = 1;
Grid[15,17] = 1;]]>
      </Expression>
    </ZExpression>
    <UseMaterial Material="Material"/>
    <RenderMesh Mesh="Mesh"/>
  </OnRender>
</Model>
Good luck ~
K
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

cool thanks!

Post by jph_wacheski »

Thanks Kj, that is a cool technique I like it! I will mess around with that and see how I can utilize it,. Im sure I will make use of it if not for this game, perhaps for another. would be fun for some really retro style games,. .

I'm not sure however how much gain doing the rendering this way could give here, as my current method gives me 60fps when the player is not moving, and therefore the light is not being calculated. (only dips to 56 or so each move)

In a turn based game such as this the over all rendering speed is not really a huge concern,. I could be rendering 3d models for each tile! also currently the wall tile is randomly rotated/scaled/tinted for each position;

Code: Select all

float n_pos=noise_data[xi.iteration,yi.iteration];

brush.translate.x=xi.iteration;
brush.translate.y=yi.iteration;
brush.rotate.z=floor(n_pos*15)*.25;
brush.scale=1.3+n_pos*.3;

dyna_c.color.a=maze_data[xi.iteration,yi.iteration];  //lighting

dyna_c.color.r=.8+n_pos;
dyna_c.color.g=.8+n_pos*-1;
dyna_c.color.b=.8+noise2(yi.iteration,xi.iteration);
Unfortunatly this would not be possible with the layered bitmap system,. . :(

I would however like to optomize the raycasting light calculation part so when the player does a move the update is as fast as it can be.

Really my reason for developing this little project was more to use the methods learned for AI in the future,. line of sight type stuff,. utilising an array/grid for general coordinants,.. and likely haveing more detailed collitions and such at another scale,. . I just often get sidetracked when testing stuff when I see a neat game possibility in the experiment.
iterationGAMES.com
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,

You can still use this technique .. instead of one tile the diffuse texture can hold a number of randomly rotated versions of that tile. It should make quite a difference on low-end machines whether you do 1000+ render calls ( one for each cell ), or just 2 ( one for walls, one for floors ). The key thing to keep in mind here ( same with the raycasting ), is that when it's static ( the walls don't change rotation during the game ) it pays to sample / buffer.

Of course once you start using 3d models ( in combination with a perspective camera ) this becomes useless again :wink: But even then you don't want to just render a box for each cell in the grid ... "small" decisions can have huge impact on your workflow / performance.

K
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Just a quick update on progress with the ATI-error on which I did some debugging today. Problem is that the ATI-equipped computer belongs to my co-worker at the office so I can only use it during his lunchbreak :/ . I could not find a stable way to crash the designer. Sometimes it works to design a bitmap using the graph editor sometimes it crashes horribly inside ati-driver with no chance of debugging. In the latest stable release of ZGE (1.9.7) I can generate and run the CleanseCube project, but in the beta it crashes on startup. This means that the current beta is not stable on ATI. During next lunchbreak-debugging session (which will be on monday) I will step through the initialization of CleanseCube and see where it breaks. Hopefully this will give the insight needed to fix the problem.
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

I know a person that owns an 4xxx ATI card... and lives in Sweden.... Too bad it might be something like 4-hours car trip from your place :P
Seriously speaking...
Really AMAZING job JHP! you have to find someone to sell your games to!!! :D
On a side note: I've rushed a little, but I've done all of my exams and I'm getting my bachelor degree on Tuesday the 22nd :D
This post was mainly to say that I am not dead, I had just gone for a while :P
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

tehe,. thanks for the kind words about my silly little games,. indeed I do need to try to sell some to make some sort of living,. as I am way too currenly poor and spongeing off family/friends, to survive. . however I keep learning new stuff and sharpening my skills,.. soon come.

I am glad you got the degree,. and do hope to see you adding more cool stuff to the ZGE, and posting cool tech. demos !
iterationGAMES.com
User avatar
diki
Posts: 140
Joined: Thu Sep 11, 2008 7:53 pm
Location: GMT+1
Contact:

Post by diki »

jph, i'd also like to tell you that the game looks & feels really nice in that last version. the oscillating lighting on the floor & that wall texture (shines like wet pebbles...) give the cave a friendly warm 'sparkling' feeling. i like it when games are pleasant places :) - doesn't happen too often these days.


congratulations on your degree, francesco!
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

beta bug fixer

Post by jph_wacheski »

glad you are liking it so far Diki!

Here is the build from the latest beta to test the ATI bug fix,. .

note; the little while blocks that seem random are supposed to line the monsters shot path,. but my lame trig work still not working,.. . hay Francisco if you got time perhaps you could help me with this one,. . or anyone that knows their trig,. and nested loops, . let me know. I will work it out eventualy, but I am working on a bunch of things,. and some help may just speed up the development of this,. .

please post ATI test results!
I tried it (last ver) on the TIGRAC laptop (that is ATI) and it worked fine so only some ATI's have this problem.
Attachments
InTheShadows_025.zip
.exe file to test.
(38.28 KiB) Downloaded 707 times
iterationGAMES.com
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi jph,

I actually wrote a RayGrid3D intersection function some time ago .. I could convert it to RayGrid2D if you want ( almost done already though ) :roll:

K
Attachments
RayGrid2D.zip
(30.74 KiB) Downloaded 687 times
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

I got Raigan to test this latest build, as he was deffinetly haveing the ATI issue, and;
it works!!

the smooth camera movement is really great, it definitely makes it
feel really nice compared to regular roguelikes.
Great work Ville bug squashed! I will make more improvments to this soon.
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Ah great news :) . The strange thing is that although the crash seems to be related to ATI-drivers it wasn't any change in the OpenGL code that caused the crash, instead it was the customized Delphi system unit. But maybe it affects the memory layout which in turn caused a crash inside the driver. Anyway I'm glad it's fixed now and maybe I can do some more debugging later to understand exactly why it was crashing, and also examine why ZGE Designer crashes sometimes during bitmap-editing (the problem yoffset experience).
Post Reply