Really big map, that loads just a part

Get help using Construct 2

Post » Mon Nov 05, 2012 10:56 am

Hei Guys and Girls, I got a big question.

What you need to know:
- I try to create a browsergame in construct 2
- I want to create a grid map
- I want just load what the user see
- The full Map is 255 * 255 (65025 fields)
- The fields should not look same (trees, water, mountains and so on)

First what I want to do:
- A big Map in 3 resolutions (500*350px/ 120*80px/4*4px per field)
- The Map should just draw the fields in the viewpoint and some around
- The Map should only request informations from the fields in the viewpoint...
- After Dragging it should draw more fields and load more

What I send to my db and what I get:
- I send the id from the city where I came from
- Db take it as middle city and send me all informations from the fields around that city

Sry for bad english ;)localboss2012-11-05 10:57:45
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Mon Nov 05, 2012 3:40 pm

I haven't done this myself, but I have had the same thought about it. At some point I wanted to do some kind of simple old school 2d Zombie GTA kind of thing. I figure the project would be fairly large so I never started. But I did ponder about the large map issue as I felt that would be the most difficult hurdle.

As I approached the theory I cam up with two ideas. I don't claim these as only or best solutions. Just ideas based on how much I understand C2.

One. C2 functionality
Have a two large set of empty sprites of a variety of sizes and ID/Use types.
Buildings, Cars, Roads, Sidewalks.... These empty sprites are always the same name. Your dynamic sprites are managed as two types(A and B) to manage sprite loading for when changing the environment.

Define a system to alternating URL load different sprite set's based on the players position in city grid.


Two. Plugin
That does the above, but removes a very complicated Event Sheet.


Anyways. that's my two thoughts on the subject. I would like to see someone pull off the really big map idea. I may end up tinkering on my project sooner than later :P
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Tue Nov 06, 2012 8:56 am

I got almost the same idea but all my tries didnt work. For construct classic was there a perfect addon.. For 2 days I have tried everything, I hope some else got a good idea.

Still big thanks to jayderyu.
B
15
S
6
G
6
Posts: 512
Reputation: 5,550

Post » Tue Nov 06, 2012 9:12 am

An idea I had was to use the sprite bank and array plugins, dividing the area of the layout at runtime in a grid (by basically checking if environmentsprite x/y is within a square, then looping through all the grid sections in the layout) then saving all the objects in each section of the grid via the sprite bank plugin as a JSON string into a cell in the array.

Then you can compare the location of the player and each time they move out of a grid section, create and destroy objects that are in/out of range.

I haven't tried this yet, and it might be more complicated than it sounds, but it seems like it should work.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Tue Nov 06, 2012 9:17 am

Hears really complicated, but thanks I will try it.
B
15
S
6
G
6
Posts: 512
Reputation: 5,550


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests