Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Data structures to handle multiple enemies

Author
Message
haYnguy
16
Years of Service
User Offline
Joined: 5th Jun 2008
Location: on my island
Posted: 30th Jun 2008 07:58
i'm trying to figure out a way to use data structures to handle multiple enemies. I tried to use a linked list. (i'm only working with 5 enemies i'm very much aware that linked lists' search is O(n) hehe ) but when I compile, i get this error:

1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library


does this mean I can't use the standard library?

i'm using a struct to keep tabs with the enemies in the game:





where the stringray is the object of the enemy class which has all the stats of the enemies, and id is the object id stored in DGDK

I'm trying to load the enemies meshes,position the meshes, store the object id number and create an object of the class and push it on to the list, simultaneously.




is there anything wrong that I'm doing/is there a better way to approach this?

-- from my island, aloha wau 'ia 'oe --
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 30th Jun 2008 20:14
no - it means you need to do more googling in this forum to find out out how to get thorugh these linker issues.

"Tempice" (I think is his name) was frequenting here a bit a while back and was a linker master - he helped figure out a lot of DarkGDK linker issues, another one who is good for it is Lilith!

Do some "linker" searches and see what ya find. You usually have to either exclude a lib or two or something - or use non-debug libs or something - because DarkGDK didn't release a debug version of their lib's. But most of those linker issues you can get by.

Note - I recommend you drop the linked list deal though - and use dynamic arrays.

I love linked lists - and for business use them alot fro simplicity - but to squeeze out the frame rates - as you MUST do with DarkGDK - you really need to make your own "array" system - that is smartenough to grow as needed, and smart enough to "reuse" holes in the array (spots where bad guys were, but died).

Trustme - looping through the array to process things is WAY faster than linked list navigation. I didn't think it would be that much of a difference until I watched a whole implementation begin to crawl and only regaining my FPS after a systemic (global) change to arrays anywhere that speed was an issue.

Example: An Inventory a RPC char is carrying doesn't need to be interrogated each render - so a linked list for this is perfect, however, a list of bad guys, bullets in the air, particle processing... etc...

USE the ARRAYS!

--Jason

Login to post a reply

Server time is: 2024-11-20 15:20:01
Your offset time is: 2024-11-20 15:20:01