Thread: the redeeming demo :D

  1. #1
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065

    the redeeming demo :D

    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.

    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!
    Last edited by jdinger; 07-16-2002 at 10:01 PM.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    194
    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.

  3. #3
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    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.

  4. #4
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    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:
    Code:
    bool bPaused;
    //prog init
    bPaused=false;
    And when ever you get a WM_ACTIVATE message then check the
    wParam:
    Code:
    //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"..
    Code:
    //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.

  5. #5
    Registered User JoshG's Avatar
    Join Date
    Mar 2002
    Posts
    326
    I got 86fps. 350mhz, with 6mb video. Looks nice.

  6. #6
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    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

  7. #7
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    thanks for the info Jdinger

  8. #8
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    FPS between 746 and 1024 for me, 860avg. =)

    P3@1GHz, 512MB SDRAM, Win2K Pro, GeForce3 Ti500 /w 64MB DDR RAM
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  9. #9
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    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?
    My Website

    "Circular logic is good because it is."

  10. #10
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    on a p2@333 /w 16mb vid card, and a p1@200 /w16mb vid card, 60fps
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  11. #11
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    hey, it's looking good, jdinger. my measely 3 fps from before shot all the way up to 75 fps this time. 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

  12. #12
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    -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.

  13. #13
    Registered User
    Join Date
    Feb 2002
    Posts
    145
    That is very good. Period. Post the finished product, then I will be able to sleep at night. Excellent job
    "Um...well..."
    -Kyoto Oshiro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Forming RTS Demo Team – Sixth Extinction
    By SteelRain4eva in forum Projects and Job Recruitment
    Replies: 0
    Last Post: 06-08-2006, 08:47 PM
  2. Finding a knoppix demo in win32 form
    By Stan100 in forum Tech Board
    Replies: 3
    Last Post: 01-15-2005, 06:08 PM
  3. Adventurers and Outlaws and new Demo
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 11-07-2004, 05:06 AM
  4. Second MoA Demo Tomorrow
    By harryP in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-30-2002, 07:22 PM
  5. SkyLock graphics engine demo
    By jdinger in forum Game Programming
    Replies: 18
    Last Post: 06-26-2002, 07:58 AM