Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Text-based LVL editor (lol)

 
Post new topic   Reply to topic Printable version
 View previous topic  Linux Directory Server (port) Post :: Post Edited Continuum 0.40 client  View next topic  
Author Message
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Thu Sep 04, 2008 11:17 pm    Post subject: Text-based LVL editor (lol) Reply to topic Reply with quote

Small thing I made... mainly for L.C. and Snrrrub who seemed interested in the effects of having tiles outside the 1024x1024 boundary. So here is a small program to make .lvl based on simple text input.

Syntax:
X,Y,tile

Example:
1,2,3 will put tileID 3 at coordinate (1,2)

One tiledef per line

Limit (as per lvl format) is 4095,4095 for coordinates, and tile id can't be > 255

have fun

My predictions if Continuum encounters a tile outside the 0,0 - 1023,1023 area:
-Either a crash
-Some warning about an invalid LVL file
-These tiles would be completly ignored

I'm also curious about WORMHOLES outside the map... if it doesn't crash the game, there is a slight chance the wormholes would still be registered, without the tile being there (i.e. the tile is ignored, but it still adds the wormhole in its list of wormholes)
Cause wormholes are definitly put in a separate array, with their own x,y struct, so these are not limited to 1023,1023. Unlike tiles, which are most likely put in a large 1024x1024 array, and putting anything outside that = BOOM.
_________________
(Insert a bunch of dead links here)




txt lvl edit.zip - 5.68 KB
File downloaded or viewed 56 time(s)
Back to top
View users profile Send private message Add User to Ignore List
Hakaku
Server Help Squatter


Joined: Apr 07 2006
Posts: 299
Location: Canada
Offline

PostPosted: Fri Sep 05, 2008 12:31 am    Post subject: Reply to topic Reply with quote

Well I tried putting a tile at 0,0; 700,700; and 1025,1025. The result was the following: 0,0; 700,700; and 1,1. So I then tried to place tile 1 at 0,0; and tile 2 at 1024,1024 and the result seemed that the tiles overlapped (Continuum was showing tile 2).

So the result wasn't quite one of your three theories.
Back to top
View users profile Send private message Add User to Ignore List Send email
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Fri Sep 05, 2008 1:08 am    Post subject: Reply to topic Reply with quote

nice

and if you do like...

a wormhole at 0,0
and some other tile at 1024,1024

will the wormhole still be there?


I'm also guessing that whatever tile is written last will be the one on top, so if you put
1024,1024,1
0,0,2

tile 2 will still be the one shown?
Back to top
View users profile Send private message Add User to Ignore List
Snrrrub
Novice


Joined: May 29 2008
Posts: 37
Offline

PostPosted: Fri Sep 05, 2008 1:53 am    Post subject: Reply to topic Reply with quote

I think the only really interesting question is if the extra 4 bits per tile are used by Continuum. The x and y coordinates are in the range [0, 1023] and the tile value is in the range [0, 255]. That's 10 bits for x, 10 bits for y, and 8 bits for the tile value = 28 used bits. All of that information is encoded in a 32-bit field on disk so that leaves 4 unused bits. That begs the question: are they really unused or does Continuum do anything special if those bits are set?

Clients generally read the map data into a large array like so:

Code: Show/Hide

for each field f in mapFile:
    x = f & 0x3FF
    y = (f >> 12) & 0x3FF
    tile = (f >> 24) & 0xFF
    mapData[x, y] = tile


This kind of code has 3 implications:
1) The x and y fields cannot be outside [0, 1023] because the upper 2 extra bits are masked out.
2) If you try to write out of bounds, you'll set the "unused" bits but your coordinates will still be modulo 1024.
3) If two or more fields refer to the same (x, y) location, only the last one will be used.

Samapico, I haven't seen your code but I'm assuming you're not masking the top 2 bits of the x, y coordinates? Your code should resemble:

Code: Show/Hide

x = readInt() & 0xFFF
y = readInt() & 0xFFF
tile = readInt() & 0xFF

write(x | (y << 12) | (tile << 8))


-Snrrrub
Back to top
View users profile Send private message Add User to Ignore List
Samapico
No, these DO NOT look like penises, ok?


Joined: May 08 2003
Posts: 1252
Offline

PostPosted: Tue Sep 09, 2008 9:48 pm    Post subject: Reply to topic Reply with quote

Yeah of course I'm not masking these bits in this program, that was the whole point tongue.gif



Also, since Continuum ignores these bits, I thought of a use for them in DCME.
Basically, I'd use these bits to save the information about walltiles... basically, which walltile set does this tile belongs to. This would make it so it wouldn't require any extra data in other files, or in eLVL. (Such data in eLVL chunks would almost double the filesize; +3bytes for each walltile)
It would allow for 14 walltile sets, which is more than enough to cover the whole tileset, especially since the walltile patterns would include diagonals, and pretty much any shape (8 surrounding tiles => 256 patterns)
And 14 because there would be the possibility of a tile that is on the map, but that was just a consequence of an adjacent walltile, so DCME would have to ignore it on loading... or it could load it and overwrite that tile... that will be to determine whenever I jump in this.
Anyway, the result of this will be selections that can be flipped / rotated, and the walls would stay intact
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Misc User Apps All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 667 page(s) served in previous 5 minutes.

phpBB Created this page in 0.427942 seconds : 33 queries executed (93.6%): GZIP compression disabled