Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: My First 3D Game

  1. #21

    My First 3D Game

    Quote Originally Posted by technomage
    I decided to write a short information sheet on the implementation of TFastObject over at Cerebral-Bicycle, you can read the article here
    I've read the article and an alternative has occured to me. Why not using "object" declaration instead of "class"? This way you can create a large block which will contain 10000 of such objects at once and then assign correct pointers to each of them. In addition you may use a replacement memory manager like FastMM to improve the performance.

  2. #22
    Legendary Member cairnswm's Avatar
    Join Date
    Nov 2002
    Location
    Randburg, South Africa
    Posts
    1,537

    My First 3D Game

    A new update has now been loaded. (Same location as above) Alien Invasion is now starting to look like a game

    Aliens now fly toward you and shoot.
    You take damage from their lasers - but can still crash into them.
    You get score if you shoot an alien.
    You lose score if an alien gets past you.
    You can move left and right a little faster.
    F4 to turn AutoFire on - you cant turn it off yet.
    f6 to make the game faster.
    F5 to make the game slower.

    No effect yet when you die. Aliens just contiue but you cant do anything.
    ESC to quit.
    William Cairns
    My Games: http://www.cairnsgames.co.za (Currently very inactive)
    MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)

  3. #23

    My First 3D Game

    [quote="technomage"]I decided to write a short information sheet on the implementation of TFastObject over at Cerebral-Bicycle, you can read the article here

    Hope you find it usefull, if there is enough interest I'll post the stuff on a Frame Memory manager at some point and how it ]

    Great stuff Dean! It wouldbe great to get this into the Articles section on PGD as well.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #24

    My First 3D Game

    Quote Originally Posted by Lifepower
    I've read the article and an alternative has occured to me. Why not using "object" declaration instead of "class"? This way you can create a large block which will contain 10000 of such objects at once and then assign correct pointers to each of them. In addition you may use a replacement memory manager like FastMM to improve the performance.
    "object" is an alternative, but I'm not sure how much faster it would be, besides the benifited of deriving from a "class" I think would outweigh the benifits of using "object". I found an article on this at http://www.engineeringobjects.com/Bo.../BadDelphi.htm. At the end of the day it's down to personal preference. I know Delphi recommend NOT using "object" but I don't know if Free Pascal recommend then same thing :?:

    Replacement memory managers are also a good move, I've used QMemory in my application, in conjuction with the changes I made in TFastObject.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

  5. #25

    My First 3D Game

    Quote Originally Posted by technomage
    I decided to write a short information sheet on the implementation of TFastObject
    Thanks again, I'll read it when I've a little time, it looks interesting.
    sorry for my English.....

  6. #26

    My First 3D Game

    I've dowloaded Alien Invasion, it seems a good starting for a space shooter
    I'm making something similar, but using GLScene. I'll post it when it is a little more advanced
    sorry for my English.....

  7. #27

    My First 3D Game

    Quotation from Delphi's help for TObject.NewInstance:

    Override NewInstance only for special memory allocation requirements. For example, when allocating a large number of identical objects that all need to be in memory at the same time, you could allocate a single block of memory for the entire group, then override NewInstance to use part of that larger block for each instance.
    One more way to get faster allocation is to use good-old free-lists. Example: let's say we have object for each dynamic effect. Instead of creating new effect each there happens, you just don't deallocate old one, but mark it as "free-for-use", put it in "list-of-free" objects, or whatever, and your allocation gets even faster!
    blog: http://alexionne.blogspot.com/

  8. #28

    My First 3D Game

    I agree "Free Lists" are the way to go with things like Particle engines, where you could be creating and freeing 1000's of objects at the from one frame to the next.
    <A HREF="http://www.myhpf.co.uk/banner.asp?friend=139328">
    <br /><IMG SRC="http://www.myhpf.co.uk/banners/60x468.gif" BORDER="0">
    <br /></A>

Page 3 of 3 FirstFirst 123

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
  •