the redeeming demo :D [Archive] - C Board

PDA

View Full Version : the redeeming demo :D


jdinger
07-16-2002, 09:59 PM
After realizing that I was poorly rushing through my code and missing some big design flaws, I decided to take a week and just hit the notepad/pen and rework some of the major elements of my game engine. And I feel it paid off. I am able to get 30+ fps on my crappy laptop with 2mb of vid mem and a 266 mhz processor and 86+ fps on my desktop p3 933 mhz with 16mb vid mem.

You can download the demo here (http://www.geocities.com/jd_eadg/code.html).

It features:
1-Full functioning map scrolling with custom clipping algorithms (that was the hardest hill to climb!)
2-Interactive GUI - you can use the sample combobox to adjust mouse movement speed.
3-No wasted blits as my custom clipping algorithms ignores tiles that are outside of the viewable area and properly clips/adjusts those that are.

Now that I've got these features in place I can start to work on the map/scenario editor (which I will *probably* release with the final game) and the troopers'/bots' AI.

Let me know what you think!

RpiMatty
07-17-2002, 12:22 AM
I get 60 fps on my laptop ( Pentium 3 700 mhz, S3 Savage graphics 8mb vid ram).

Looks good, except when the mouse is on the edge of the screen scrolling, it "sticks" to the edge, requiring a big movement to get it to stop scrolling.
I assume this is intentional to aid in scrolling, but it seems that it requires too much "force" to pull the mouse away from the edge, to stop the scrolling.
This looks like a turn based game you are developing (im new to the games section of the cboard so i havent seen any previous demos) so its not that important to be able to select units quickly, but maybe for the final release you could add an option to turn the sensetivity of the scrolling down.

Thats just my opinion, I cant wait to see the final game.

Clyde
07-17-2002, 05:16 AM
looks great jdinger, hey i was wondering if you knew how to impliment alt-tab so that it doesn't kill the program?

In my game (which is full screen) if i hit alt-tab i get an error, in yours i notice that it minimises ok, but when you go back in you have a black screen.

jdinger
07-17-2002, 06:58 AM
Originally posted by Clyde
looks great jdinger, hey i was wondering if you knew how to impliment alt-tab so that it doesn't kill the program?

In my game (which is full screen) if i hit alt-tab i get an error, in yours i notice that it minimises ok, but when you go back in you have a black screen.

Clyde,
To correct the alt-tab black screen, use a variable to hold the games running/paused state:

bool bPaused;
//prog init
bPaused=false;

And when ever you get a WM_ACTIVATE message then check the
wParam:

//in your message proc
switch(msg)
{
case WM_ACTIVATE:
{
if(LOWORD(wParam)==WA_INACTIVE)
{
bPaused=true;
}
else
{
bPaused=false;
RestoreYourSufaces();
ReloadYourBitmapsOntoYourSurfaces();
}
return(0);
}break;
}


Then in your main game loop if bPaused=true don't update the game logic/art/etc. but go into a "paused state"..

//main game loop
if(!bPaused)
{
DoGameStuff();
}
else
{
Sleep(1000);
}


I haven't implemented this in the primary game build yet, just in small demos to test it out. The ficticious functions above (RestoreYourSurfaces() and ReloadYourBitmaps...()) would just be your own custom functions to do just that. Look in the DirectX help file for Restore and RestoreAllSurfaces.

Originally posted by RpiMatty
Looks good, except when the mouse is on the edge of the screen scrolling, it "sticks" to the edge,

RpiMatty, I feel your pain. :) That's something I need to work on. I have spent the last week or so, reworking my scrolling/tile clipping routines and I need to get back in there and tweek my DI code. Right off hand, I don't have an exact answer as to why it's "sticking". Whenever I tweeked it to allow "autoscrolling" this bug popped up.

JoshG
07-17-2002, 08:28 AM
I got 86fps. 350mhz, with 6mb video. Looks nice.

MrWizard
07-17-2002, 09:48 AM
It crashes on my school's computer :( They have pretty sorry computers though.

Windows 2000 Professional
Pentium II 450mhz
ATI Rage 128 GL AGP 8mg
128MB System Memory

Don't know if it is because of the ATI or what. Well I'm sure it is a good demo anyways ;)

Clyde
07-17-2002, 10:14 AM
thanks for the info Jdinger

XSquared
07-17-2002, 11:46 AM
FPS between 746 and 1024 for me, 860avg. =)

P3@1GHz, 512MB SDRAM, Win2K Pro, GeForce3 Ti500 /w 64MB DDR RAM

DavidP
07-17-2002, 12:03 PM
very nice very nice...

i like the hexogonal map system you are using, ive been wanting to use the same type of map system on the next game i am going to make after i finish my current one.

whatd you do for the graphics? did you make the stuff yourself or find them?

XSquared
07-17-2002, 12:11 PM
on a p2@333 /w 16mb vid card, and a p1@200 /w16mb vid card, 60fps

TechWins
07-17-2002, 03:27 PM
hey, it's looking good, jdinger. my measely 3 fps from before shot all the way up to 75 fps this time.:eek: good job working on that.

i'm curious; what is the screen capture recording for?

btw, here are my specs again:

500 mhz processor, win2k, 384 mb ram, 4 mb video card

jdinger
07-17-2002, 05:00 PM
-by DavidP-
whatd you do for the graphics? did you make the stuff yourself or find them?

David, I make them myself using 3dsMax. I use a freeware raytracer called Pov-ray to create a lot of my textures, but all the sprites themselves are modelled/rendered in 3ds and then exported as bitmaps.

If you need any info on hex tiles, let me know. I plan on making a good bit of the code open source. The initial learning curve was a big pain but now all the hardwork is done (as far as hex at least :) ) and I think it was worth it. I really like the asthetics of the hex maps/tiles.

-by TechWins-i'm curious; what is the screen capture recording for?

Tech, the screen capture has a few different uses. The main one is so that I can take screen shots of gameplay when I hit alpha and have some to show. Also gamers can take screenshots, etc. of gameplay if they wish.

The most useful one so far wasn't really expected. I was having some trouble reworking one of my offset plotting algorithms for my custom clip routine. So I took a screenshot and then exitted the game and opened it in Paint Shop Pro. Then I could track the exact pixel in PSP that I was looking for and given that pixel I had the answer to my algorithm. From there I just worked backwards until I figured out the right formula. It was a big time saver.

Kyoto Oshiro
07-17-2002, 10:49 PM
That is very good. Period. Post the finished product, then I will be able to sleep at night. Excellent job :)