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 / Linked List

Author
Message
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 00:33
Hi,

Is it a good idea to use Linked lists for things like storing enemy info in a little RTS? or would it be better to use a standard array?

If linked lists i dont suppose someone has a little code that creates a list adds nodes and can traverse and delete nodes, i can make a linked list but not the deleting and travering

If i dont know,
I'm sure you will
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Dec 2004 02:38
Probably - got some source code for my doubly-linked list DLL here.

Walk softly... and carry a big gun...
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Dec 2004 02:44
Who can tell?

Unless you can tell us what you need to do with the objects you want to store, we can't really suggest a best match.

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 03:00
Well its jus a mini RTS as a test project. So the more houses the player/AI unit builds the bigger the population, coz i didnt really want to set a limit on the anount of units each player can have i wanted to know if linked lists would be viable, also i thought it may be easier to maintain than an array??

source for double linked list may be a good thing to look at?

If i dont know,
I'm sure you will
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Dec 2004 03:05 Edited at: 8th Dec 2004 03:05
The main file

Walk softly... and carry a big gun...

Attachments

Login to view attachments
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Dec 2004 03:05
Header

Walk softly... and carry a big gun...

Attachments

Login to view attachments
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 03:11
Thanks TGC
Same offer go3es out to you as i made to dave, if ure in Cornwall beers on me

If i dont know,
I'm sure you will
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Dec 2004 03:11
The whole thing : #include <list>

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 03:13 Edited at: 8th Dec 2004 03:14
Care to extend on that Ian
is that some kind of namespace

If i dont know,
I'm sure you will
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Dec 2004 03:27
I think he's trying to get you to go over to The Dark Side and start using C++...

Walk softly... and carry a big gun...
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 03:39
Well using the Dark game sdk so maybe the darkside is a good place to be
I didnt think linked lists were used in c

If i dont know,
I'm sure you will
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 8th Dec 2004 03:48
They aren't standard in C...

Walk softly... and carry a big gun...
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 04:19
ahhh...sneaky

If i dont know,
I'm sure you will
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 8th Dec 2004 05:03
It's a C++ thing - the Standard Template Library (STL).

Here's a link to the SGI documentation : http://www.sgi.com/tech/stl/table_of_contents.html

And here's a link to a tutorial on the STL : http://www.yrl.co.uk/phil/stl/stl.htmlx

Seeing as you've got a C++ compiler, it'd be a shame to not use it ...

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins and source code http://www.matrix1.demon.co.uk
Mnemonix
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: Skaro
Posted: 8th Dec 2004 05:07
Good oh STL.

I am on the dark side too .

The 3d chat is coming...
Rights For Traffic Cones!
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 05:24
lol,

I'm slipping to the Darkside
DarkSDK is just what i needed to get me interested in c/c++ again, really is theraputic to use

If i dont know,
I'm sure you will
billy the kid
19
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 8th Dec 2004 12:12
I would recommend using a vector instead of linked list, but thats only if the linked list is a singly linked list. Thats because you get the speed of an array but the flexibility of a linked list. In case you dont know, a vector is exactly like an array but it can be extended like a linked list. The easiest way to implement a vector in C++ is using STL. Just look it up on google.
gdogg2k
19
Years of Service
User Offline
Joined: 20th May 2004
Location: Cornwall, UK
Posted: 8th Dec 2004 23:37
Vectors have worked out perfect for 2 things now, managing the units and player info, also for porting BlitzUI GUI system from blitzbasic to darksdk

Thanks Mr Kid sir

If i dont know,
I'm sure you will
billy the kid
19
Years of Service
User Offline
Joined: 7th Dec 2004
Location:
Posted: 8th Dec 2004 23:47
Good.

Login to post a reply

Server time is: 2024-04-20 10:05:56
Your offset time is: 2024-04-20 10:05:56