Best behavior for a topdown RPG NPC?

For questions about using Classic.

Post » Thu Nov 05, 2009 10:42 am

Ooohhh nice! Thanks. Back to topic, I'm pretty sure it would be laggy if I make my rpg in ONE HUGE LAYOUT and fill it with.... EVERYTHING... How big can a layout be in its size?
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Post » Thu Nov 05, 2009 10:58 am

Hmmm there are some limitations. Biggest layout I've been able to get away with was 12000x12000, and that was with a fair bit of optimisation.

I've tried systems that don't work with a layout per se, but actually store the level in an array which is drawn as the "virtual position" of the player is changed. With that, I really can't see a limitation on level size. Couldn't get it working but I haven't tried that hard, and I realise thats not an amazing explanation...

Diagram may help:
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Thu Nov 05, 2009 11:27 am

Actually, roofs, treetop and stuff could be drawn on layer above, only including obstacles on base layer (where player is located). So, you'd use two-level array (or more if you include more levels). Then you draw additional stuff on these layers with offset, turn on/off for visibility etc.
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Nov 05, 2009 11:43 am

I was thinking that if I make one city in one layout and trying to avoid NPCs from going anywhere, I would just set roofs in houses to opacity 0, and that if the player goes in, the roof's opacity becomes invisible or something. But of course, it does not apply to NPC since they wont need it. And if the town is big enough, then probably NPCs going outside of that map may be needed no longer.

And if they do, I'd just make some kind of counter that:

If NPC1 goes out of map1, then NPC1Outsideoftown=1 indicating that NPC1 is no longer in map1 and but in Map2.

If Map2 is loaded, it checks which NPC has a value of 1 in the NPC1outsideoftown variable. Maybe I could make it a private variable. But I think that would be time consuming.
B
10
S
5
G
8
Posts: 203
Reputation: 4,395

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests