NPC Management

For questions about using Classic.

Post » Fri Jun 04, 2010 3:04 am

Hey, what would be the best way to manage approx. 100 NPC's over different layouts?

If any more info's needed let me know.
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Post » Fri Jun 04, 2010 3:22 am

[quote="YetAnotherSuperhero":39rpiwc9]If any more info's needed let me know.[/quote:39rpiwc9]

Alot more info is needed! :wink:

1. Will the NPC's be "active" on different layouts even though that layout may not have the current focus? For example, you leave a layout and move to a new area but when you return the NPC has traveled around and not where you last saw it.
2. What does manage mean? Do you need to know NPC stats all the time in all layouts?
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Fri Jun 04, 2010 3:30 am

Okay, well...

Preferably, my game will have 100 +/- ships that would run trade goods between sectors, and even fight each other. So the galaxy would evolve.

Ambitious, I know. And probably a little ridiculous, but even if I could "simulate" that and just move NPCs between sectors whether you're in the galaxy view or the system view. Would be great.

Any more info needed?

Thanks!
Follow me on Twitter @evgLabs
B
33
S
14
G
4
Posts: 251
Reputation: 4,049

Post » Sun Jun 06, 2010 3:36 am

I think you are in uncharted territory here, so experimentation is probably best. It would probably take quite awhile to even start to draw up a plan for something like this. It's definitely going to be complex! :)
B
8
S
3
G
7
Posts: 835
Reputation: 5,313

Post » Sun Jun 06, 2010 4:32 am

Sounds like it will be quite complex, indeed. While I wouldn't say that Construct wouldn't be able to handle the data storage and manipulation with it's native data structures, I would suggest thinking about using lucid's 's' plugin, or Python Classes, to deal with all of the data needed for such a game.

I have not tried the 's' plugin. It sounds like it would fit the ticket nicely, though. Since I am quite comfortable with Python, though, I would definitely use classes for each of the components involved. Object-oriented strategy would work well for something like this. At least, one can use Python Classes as a sort of c-like 'struct' in which one can have structured groups of different types of data with meaningful names. These are also capable of pointing to each other, thus 'linking' to each other. It can be a bit tricky interfacing Python code with Construct's events, but it's not too bad...

I'm not sure of your sectioning of the game universe, but off of the top of my head, I can see I'd want some basic data structures like so:

Ship:
- 'Health'
- Speed
- Armor
- Class of ship
- Armaments (list)
- fuel capacity
- current fuel
- cargo capacity
- current cargo (list)
- current location

Station/Planet:
- sector located in (link to sector)
- Type of economy
- population
- crime level
- needed goods (list)
- surplus goods (list)
... etc

Sector:
- bordering sectors (list of links to other sectors)
- ships in sector (list of links to ships)
... etc

... and much more data than that, depending upon the complexity desired. The trick is to make it as simple as possible in the hidden inner workings of the game, while making it seem complex/realistic to the player. It could be as simple as having an array/list of ships that you loop through every tick of the game, having them make decisions based upon semi-random choices.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Mon Jun 07, 2010 9:17 am

You should take a look at this
http://www.gamasutra.com/view/feature/1 ... s_for_.php

I think It will help you with your Npc AI and management.
the info here show you how to do what you want.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests