Results 1 to 10 of 12

Thread: Do I need a graphics engine?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by Ņuņo Martínez View Post
    Let's SPAM a bit.
    ...
    End of spam.
    Haha, yeah I might check out Allegro later.

    Quote Originally Posted by SilverWarior View Post
    I must say that I'm a bit surprised by hearing that. I guess that large difference between older stable version of FPC/Lazarus and newest might be the cause for this. Besides since FPC/Lazarus is completely free PXL author is probably expecting that everyone is using latest version which could not be said for Delphi developers since they have to be paying yearly subscription in order to keeping their development environment up to date.
    Yeah, I guess the PXL site is a little confusing. It claims you need at least Lazarus 1.4 and FreePascal 3.0. I had Lazarus 1.4.4, so I figured I'd be fine, but I guess Lazarus 1.6 is the only version that uses FreePascal 3.0, so you pretty much have to use that one

    Quote Originally Posted by SilverWarior View Post
    But checking and studying the demos might also be enough. It was for me but I must admit that I had at least some basic knowledge on working with graphics before from short time usage of few other graphical engines before their development was canceled. For some reason I mostly started using of these graphical engines just before they got canceled so I never even got learn to use them properly as I did with Asphyre Sphinx 2 and later Asphyre Sphinx 3.
    Any way I recommend you start fiddling with demos and if you run in to some questions ask them here on PGD and we will try to help.
    So I've spent some time looking at the samples, and trying to replicate some parts of them. It took me some time to get anything to work, since the FreePascal samples apperently were written using "delphi syntax mode"(in the project options). This meant that even when I copied code directly from a sample it still wouldn't work until I switched that.
    I'm sure that if I knew proper FreePascal syntax I probably could have written things differently, and made them work anyways. But that's pretty hard when I have no idea how things are supposed to look.
    It's extra confusing since several samples are old and have been ported several times between different versions of the engine.


    So far I've only been looking at the timer that came with the library(TMultimediaTimer). I've been looking for a new timer for some time, since the Lazarus TTimer has felt kinda unstable to me.
    I got it working, but I'm not sure if I'm really using it right.
    Maybe I've misunderstood something, but from what I see from the samples, all it seems to do is trigger constatly on the Application.OnIdle event.
    This means that as soon as the program does something different, the timer stops counting.
    Is there a way to avoid this? I'd rather not have all graphics stop updating just because the game has to run a heavy calculation.
    If not, is there a better timer out there that I could use? Or is this just how timers work in general? Should I just make sure I make my code so effective it doesn't noticably interrupt the timer?


    Quote Originally Posted by SilverWarior View Post
    I didn't mean to scare you but merely say that there is no graphical which would be so much better than the others because it does not allow you to screw up.
    Any way if you do happen to screw things so badly to bring the graphical engine to a halt do post your problems here and we will solve them together.
    And yes many times you can learn most by screwing up first That is how I learned most about computers.
    Back in the days I used to purposely delete or rename various windows files to see what would stop working
    And I even fried few computer components but this was not on purpose

    Any way we are here to lend you a hand when you will need it. I myself didn't had this luxury or didn't know where to get help when I started fiddling with graphics myself. So I had to learn it the hard way.
    haha, yeah I understand!

    I really do appreciate the help you're giving. I really respect people who went through the process of learning things completely on their own! Although I'm not sure I'd ever have the time(or dedication) to figure all this out myself!

  2. #2
    Quote Originally Posted by ajol View Post
    Yeah, I guess the PXL site is a little confusing. It claims you need at least Lazarus 1.4 and FreePascal 3.0. I had Lazarus 1.4.4, so I figured I'd be fine, but I guess Lazarus 1.6 is the only version that uses FreePascal 3.0, so you pretty much have to use that one
    It is not the PPXL sithe what is confusing you but the sheer lack of proper knowledge about what FreePascal and Lazarus are. You See FreePascal and Lazarus are actually two separate projects (programs) where:
    - FreePascal is actually a combination of Compiler, Debugger and Linker
    - Lazarus is just a development IDE which makes use of FreePascal much easier and also allows some other features similar to the ones found in Delphi like visual UI design using LCL component suite.

    Quote Originally Posted by ajol View Post
    It took me some time to get anything to work, since the FreePascal samples apperently were written using "delphi syntax mode"(in the project options). This meant that even when I copied code directly from a sample it still wouldn't work until I switched that.
    I believe author of PXL decided to go that way in order to make maintaing support for both FreePascal and Delphi much easier as they can share same codebase.

    Quote Originally Posted by ajol View Post
    It's extra confusing since several samples are old and have been ported several times between different versions of the engine.
    I haven't checked the PXL yet but I assume some of these samples might be still left from its predecessors (Asphyre Sphinx).

    Quote Originally Posted by ajol View Post
    So far I've only been looking at the timer that came with the library(TMultimediaTimer). I've been looking for a new timer for some time, since the Lazarus TTimer has felt kinda unstable to me.
    I got it working, but I'm not sure if I'm really using it right.
    The TMultimediaTimer is a lot different than the regular TTimer that ships with Lazarus or Delphi for that matter. If you look at it in object inspector you will notice that it has two events. One is OnProcess and one OnTimer.
    OnProcess event should contain all in-game logic code like character movmements, simulation processing etc.
    While OnTimer event is actually used only for rendering.
    You can control when each of these events is fired by using Speed and MaxFPS properties. Where Speed property defines how often is game simulation being updated and MaxFPS defines what is desired screen refresh rate.
    Now the TMultimediaTimer also contains special mechanism which is able to detect if your rendering call had take too much time so that game simulation should already been updated before rendering was done. In that case OnProcess event will be fired twice in a row to allow your simulation to catch up the lost time.
    I strongly recommend reading the official documentation as I don't remember seeing any proper example of fully using these features.

    Quote Originally Posted by ajol View Post
    Maybe I've misunderstood something, but from what I see from the samples, all it seems to do is trigger constatly on the Application.OnIdle event.
    As I mentioned above that is not the case. Unlike regular TTimer the TMultimediaTimer is much more complex. And the reason why it is using Application.OnIdle event is to gain maximum possible resolution without interfering with standard application messaging system.

    Quote Originally Posted by ajol View Post
    I'd rather not have all graphics stop updating just because the game has to run a heavy calculation.
    There are only two way of doing this.
    One is avoiding any lengthy heavy calculation or at least having ability to split that lengthy calculation into multiple steps.
    Second one is implementing multithreading support where you can move such calculation to secondary thread/s. I haven't tried implementing multithreading in combination with TMultimediaTimer but I'm sure it can be done to some degree (no true asynchronous processing of graphics and game simulation). But if you really do need something like you can find Multithreaded Timer on the web.

    Quote Originally Posted by ajol View Post
    Should I just make sure I make my code so effective it doesn't noticably interrupt the timer?
    As a game developer you will have to learn on how to make an efficient code. While in business applications it is perfectly acceptable for some lengthy processing to take up to 5 seconds or even more if you show a nice looking progress bar
    in game development any such lengthy processing is already considered as serious game lag. That is in case of turn based games while in case of real-time paced games this is already considered as game hang.
    So yes in a way game development is much harder than business development. But don't let that discourage you. Instead take it as a personal challenge as it will make you a better programmer in the end. At least that is my opinion.

    Quote Originally Posted by ajol View Post
    I really respect people who went through the process of learning things completely on their own! Although I'm not sure I'd ever have the time(or dedication) to figure all this out myself!
    You just have to believe in yourself. You would be surprised of how much you can achieve.
    And BTW I'm only 6 years older than you. So we both have still lots of time for learning even thou sometimes learning speed can be a bit slow due to not having much free time to be used for programming.
    I'm sticking with this for 15 years already (last 7 years more or less focusing on learning about game development) even thou sometimes it seems I'm not making any progress.

    Just remember that there will be days where you would be as we programmers like to call it "in the zone" when you will do a lot of progress. And there would be days where you would just spend whole day banging your head around a single problem without any success.
    You see programming is not like any other work it is more like art. During good days you will make huge progress and during bad days you won't. You just have to accept that and live with it. And most importantly don't quit even when it seems that there are no good days coming.

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
  •