View Poll Results: What kind of game project are you working on?

Voters
33. You may not vote on this poll
  • Nothing at all. Too busy.

    1 3.03%
  • None, just game engines or tools.

    3 9.09%
  • I make simple free stuff for fun.

    6 18.18%
  • I'm working on a commercial project and can talk about it much. (NDA, etc)

    4 12.12%
  • I'm working on my own creator-owned project.

    12 36.36%
  • I have a lot of prototypes/ideas, but I don't really have any concrete plans.

    7 21.21%
Page 1 of 2 12 LastLast
Results 1 to 10 of 52

Thread: Who is writing a game?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Currently im working on a 3D map editor, i actually worked on it since 2008, rewrote it hundreds of times and now i have to do it again, because im unable to find fast object picking for my editor.
    Tried many things and most of them fail or are too slow.

    The rest of the features are easy. The editor is for specific game, made in 1999, my most favorite game and that's why i work on map editor for 5 years now, i had many months of doing my other things, while this project was just "freezed".

    Now im again on it. Im doing it in OpenGL and Delphi 7 Personal Ed.

    For me, making this editor, is alot more interesting than making some game.
    Im not much of a gamer, i only play few games, including the favorite one.

  2. #2
    Quote Originally Posted by hwnd View Post
    Currently im working on a 3D map editor, i actually worked on it since 2008, rewrote it hundreds of times and now i have to do it again, because im unable to find fast object picking for my editor.
    Tried many things and most of them fail or are too slow.

    The rest of the features are easy. The editor is for specific game, made in 1999, my most favorite game and that's why i work on map editor for 5 years now, i had many months of doing my other things, while this project was just "freezed".

    Now im again on it. Im doing it in OpenGL and Delphi 7 Personal Ed.

    For me, making this editor, is alot more interesting than making some game.
    Im not much of a gamer, i only play few games, including the favorite one.
    Hi hwnd, the 3d map editor sounds interesting...have you got any other information that you could share about it?

  3. #3
    OK, i have few videos on YT, im posting the latest and better ones:

    http://www.youtube.com/watch?v=tO3hsePugF4
    http://www.youtube.com/watch?v=PSubaCJXp_A
    http://www.youtube.com/watch?v=4yWoD55tSYE

    Any questions, comments?
    Sometimes movement looks laggy, but it's because video recorder.
    The program itself is very smooth.
    Im using OpenGL and Delphi 7. It was rewritten many times, if i now find a good and fast picking method, i will rewrite it again. Many things depends on it and i want to make it as good as possible. The most cool thing i want to add is animated tiles, but im not a guy who could throw out fixed FPS style animation, or even regulate FPS for each animation.
    There must be some global clock in app, on which everything is built, atm it's just Delphi TTimer, on which everything is drawn. But i don't like it.

    Hopefully nxPascal will help me on this case.
    It has some timing code, dunno if i can build my animations on that.
    Everything should be on timers, even camera movement.
    With blocks there is a thing: each block could have a animation with his own FPS, (how fast tiles are animating). I once tried it with another TTimer, but it was ugly.

    So, timing and good picking is the most needed things atm.

    EDIT: but at the same time, i don't like that the editor will take 100% CPU.
    But it should redraw fast, i tried TThreadedTimer and set it interval to 1ms. It was good, because user can just "paint" tiles on blocks and editor should draw them immediately without any delay. That's why 1ms timer. Although i know that TTimer is limited to >16ms
    Last edited by hwnd; 28-08-2012 at 09:37 AM.

  4. #4
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Quote Originally Posted by hwnd View Post
    EDIT: but at the same time, i don't like that the editor will take 100% CPU.
    But it should redraw fast, i tried TThreadedTimer and set it interval to 1ms. It was good, because user can just "paint" tiles on blocks and editor should draw them immediately without any delay. That's why 1ms timer. Although i know that TTimer is limited to >16ms
    A couple of ways to limit your frame-rate (pseudo Code) :

    ATime := GetTime();
    Render();
    While (GetTime() - ATime) < TimePerFrame do
    begin

    Sleep(1);

    {This will free up the CPU - tells the OS Scheduler it can do some other stuff NOTE : it's not garunteed to sleep for exactly 1ms, only garunteed to wait *at least* 1ms. it could sleep for 10ms in this example, for example.}

    end;

    You could use VSync on it's own - that'll just wait on GL Swap Buffer if it's called before it's time for the next frame but the above method offers more control. You should leave VSync enabled regardless, if you want to measure performance it's much better to time how long Render(); takes rather than seeing what your max FPS is.
    Last edited by phibermon; 28-08-2012 at 02:47 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  5. #5
    That is close to how nxPascal game class handles it No worries, it's perfect for making smooth 60 fps animations, while keeping CPU and GPU use near 0%.

    Actually i can show you. It supports frameskipping too for rendering (could make it optional though):
    Code:
      t:=nxEngine.GetTick;
      if t<nextTick then begin
        Application.ProcessMessages; Sleep(1);
      end else begin
    
        FrameSkips:=-1;
        repeat
          inc(FrameSkips);
          nextTick:=nextTick+FrameInterval;
          GameLoop;
        until (nextTick>t) or (FrameSkips>=10) or FNoFrameSkipping;
        Draw;
    
      end;
    Last edited by User137; 28-08-2012 at 04:29 PM.

  6. #6
    Ok, but is it possible to take some constant and use the nxPascal "tick" to generate different animations with different framerate?
    Slower / faster.

    In my case, every block could have tile animation with his own frame rate. Some anims need slower FR, some bigger FR and still be same on any PC?
    I mean animation that has slower framerate, will be actually faster in my friends computer, who has more faster pc.

    So can i divide my FR value with something from that loop?
    Im beginner in timers and animation, but i always wanted to make my editor timing better.
    Just dont have enough knowledge.
    Last edited by hwnd; 28-08-2012 at 08:25 PM.

  7. #7
    Quote Originally Posted by hwnd View Post
    Ok, but is it possible to take some constant and use the nxPascal "tick" to generate different animations with different framerate?
    Slower / faster.

    In my case, every block could have tile animation with his own frame rate. Some anims need slower FR, some bigger FR and still be same on any PC?
    I mean animation that has slower framerate, will be actually faster in my friends computer, who has more faster pc.
    This is demonstrated in the nxPascal demos many times. You have:
    - nx.GetTick <= Returns multiplatform GetTickCount. It is a millisecond timer running onwards, each 1000 being 1 second.
    - nx.GetTick2(range: integer; scale: single) <= Same as above, but you can limit it to certain range and scale
    - nx.FrameTick <= FPS counter called GetTick in the Flip and stored it here. You don't need to ask it from system so it could be marginally faster, but this is 1 frame late.

    What i prefer to use is the GetTick2(). For example:
    Code:
    nx.SetColor(1, 0, 0, 0.8+0.2*sin(toRad*nx.GetTick2(360, 0.5)));
    It makes a red color with alpha being in range 0.6..1.0, smoothly going by sine-wave. With range 360 it always returns value from 0.0 .. 359.5. You can use different ranges and speeds for each animation. If you want it to loop animation patterns from end to start way, you can use modulus math:

    Code:
    trunc(nx.GetTick2(4, 0.001)) mod 4
    This would return values from 0..3, like 0,1,2,3,0,1,... And being so slow that it only changes once per second.
    (actually this is going so theoretic i might have to test to verify It's how it's supposed to work though.)

    edit: Verified, returns single though.

    But naturally you can animate your stuff with like:
    Code:
    AnimPos:=AnimPos+AnimSpeed; // Where AnimSpeed is any floating point number
    With the default fixed FPS, it works same speed on every computer.
    Last edited by User137; 29-08-2012 at 07:28 PM.

  8. #8
    Quote Originally Posted by hwnd View Post
    With blocks there is a thing: each block could have a animation with his own FPS, (how fast tiles are animating). I once tried it with another TTimer, but it was ugly.
    Using standard timers (TTimer) for any precise timing is bad idea. The rason of this is the fact that TTimer heavily relies on Windows messages meaning that during high system loads it can become quite inacurate. Using multiple timers is even worse idea since they afect each other.
    So using TThreadedTimer is much better idea.

    Quote Originally Posted by hwnd View Post
    but at the same time, i don't like that the editor will take 100% CPU

    But it should redraw fast, i tried TThreadedTimer and set it interval to 1ms. It was good, because user can just "paint" tiles on blocks and editor should draw them immediately without any delay. That's why 1ms timer. Although i know that TTimer is limited to >16ms
    Using timer with 1ms for contoling renderning is pointles. Why? By doing so you are forcing your computer to do more redraws (1000 redraws per second) that hardware is capable of. This will in the end consume all the CPU power.
    Since you are only making editor I think that having 30 redraws per second would be more than enough. So you could simply use 33ms timer delay which makes aprox 30 FPS.

    As for animations you do have to use some global counter (integer variable) which is increased everytime you redraw your screen. Then you calculate which frame is needed to be drawn at specific time. Below is the code example.
    Code:
    TAni = record //Record defining animation information
      FPS: Integer; //Defines how many animation frames are being drawn per second
      FramesCount: Integer; //Defines how many total frames is in animation
      Frame: Integer; //Defines current animation frame
    end;
    
    ... //some code
    
    //Global unit declarations
    var FrameCounter: Integer; //Framecounter is being used to count the number of frames which has already been drawn 
                               //since its last reset
        FPS: Integer; //Variable defining desired application FPS.
        Ani: TAni; //Ani is of type TAni
    
    ...//some code
    
    procedure OnDraw; //your renderning procedure
    begin
    //code used to calculate which animation frame needs to be drawn.
    //this code can be put on the beggining off your rendering procedure
      Ani.Frame := (FrameCounter div (FPS div Ani.FPS)) mod Ani1.FramesCount;
    
    ...//some code
    
      //Code used to count how many frames have been drawns since last FrameCounters reset.
      FrameCounter := FrameCounter + 1; 
      //Below code is used to reset FrameCount back to 0 after reaching AniResetFrame. Without this code FrameCounter 
      //will eventually exceed maximum integer value which could lead t many problems. 
      //AnimationsResetFrame is constand number representing frame number on which all animations would reach Frame 0
      //at the same time.
      //It is imperitive to reset FrameCounter at the right time to avouid jumpy animation.
      if FrameCounter = AnimationsResetFrame then FrameCounter := 0;
    end;
    And one final suggestion:
    Do implement some keyboard shourtcuts for various controls. Especially for rotatng objects so you don't have to do half dozen clicks just to find the right orientation for certain objects.

    EDIT: Go and make you own thread in MyProjects section so we can continue discusion there and thus keep our forum nice and clean. I can then move relavent posts there.
    Last edited by SilverWarior; 28-08-2012 at 10:02 PM.

  9. #9
    Quote Originally Posted by hwnd View Post
    OK, i have few videos on YT, im posting the latest and better ones:

    http://www.youtube.com/watch?v=tO3hsePugF4
    http://www.youtube.com/watch?v=PSubaCJXp_A
    http://www.youtube.com/watch?v=4yWoD55tSYE

    Any questions, comments?
    Looks like you've done a good job
    BTW, I really love that music in the second video...I will have to look at getting some of Astral Projection's music!!

  10. #10
    I have some ideas for something new (a 2d puzzle game) but I don't have enough courage to start it and currently my brain is in .... COBOL programming mode due to needs of my job (I have to make the living ).

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •