10se1ucgo / ace

A ground-up CLIENT implementation of the Ace of Spades protocol
GNU General Public License v3.0
19 stars 2 forks source link

[S.O.S] Need Help with map_loading, can you help me? #6

Closed Edgamer63 closed 5 years ago

Edgamer63 commented 6 years ago

Hello :D , i need some help. I'm gonna start by telling you why i'm saying this: https://www.youtube.com/watch?v=VDgR-Dhqwss

Temporaly enabled view (DISABLED)<

Well, as it shows... i started to doing things like this 3 weeks ago (Yeah, i already do the load and draw kv6 support, and animations for tanks and a lot of more things). Well, this means a lot. Basically, im building very fast... a Whole new game with the community ideas plasmed in. Yeah, i'm doing it. And if it can be better... im working with a language that supports exports to a lot of Operative Systems [Beautiful but hard enough too by doing it alone :/ ].

Well, i've worked for 2 weeks (a lot AF), in the loading a simple map "bridgewars", and that is where the error have started. Because, that contains map solids and map spans that in lineal reading, give me a lot of errors, and IDK why.... But i already loaded Gen.vxl (The one that contains only 1 vxl data per 2D coordinates).

The point is that i need some reference, because the sample codes here in: "https://silverspaceship.com/aosmap/aos_file_format.html" , aren't enough. It would be a key move if you can bring me some reference in loading ".vxl" maps. You know, i know... it would be a good thing, and such a spin to the AoS Story.

PD: The more the secret is keeped, the safer it will be for the B&S Cause.

Thank you, i hope we are friends in the AoS Revitalizator cause.

10se1ucgo commented 6 years ago

Best I can do is point you to https://github.com/10se1ucgo/ace/blob/master/src/vxl.cpp#L56 but the code is mostly directly taken from the link you already gave. It should be relatively straight forward

Edgamer63 commented 6 years ago

Uhm. and does that load the map without any failure? :/

Edgamer63 commented 6 years ago

Well, already done! :D , thank you :) . But now, i need a new help...

Can you help me with debris algorithm? i mean, the floating-structure detector.... It would be good :D (psst, you are already in the Credits of ... well, this game xD)

10se1ucgo commented 6 years ago

The code ace uses is just a slightly modified version of pyspade's. You can find that here https://github.com/10se1ucgo/ace/blob/master/src/world/world.cpp#L98. Whenever a block is destroyed, each of its neighbors are ran through that function (face neighbors, corners are not included). The argument vector is then filled with the positions and colors of each block that was floating.

Edgamer63 commented 5 years ago

well... where you defined "emplace_back" function? :/ , i returned to job in my project :D

10se1ucgo commented 5 years ago

emplace_back is a member of std::vector since C++11. Alternatively in this case you can use push_back if you need an older version for whatever reason.

Edgamer63 commented 5 years ago

Thanks, it is useful info, i'm converting this to other language ... i still analyze debris algorithm, because i'm recently learning this type of programming xD , Thank you :3 . I think i will ask again anyway :) .

Edgamer63 commented 5 years ago

Well, i got a question.... And i don't get resolved this correctly, And that's about:

How does the read_map Engine can solve the terrain filling of solid spaces?; Because yes, it can read bytes that get the last upper block (less file size [Cool voxlap :D ]) and if is only one block, it's obviously that the merely rest to down is solid or only water.

But sometimes you got a span that have only the upper and the bottom blocks, and in the voxlap of AoS, it reads the zone as it is solid. And i dont know, even reading the code of "https://silverspaceship.com/aosmap/aos_file_format.html", i obtain something like:


for(i=z; i < top_color_start; i++) setgeom(x,y,i,0);


But it doesn't solve me any question :/ .... I also try with reading for example the vars :+1:

Let K = E - S + 1
Let Z = (N-1) - K, or 0 if N=0
Let M = A stored in *next* span, or 64 if the last span of the column

Run Start End Length
air A S-1 S-A
top S E E-S+1
solid E+1 M-Z-1 M-Z - (E+1)
bottom M-Z M-1 Z

So i come here to keep asking, because i think you may have some clue about it :3 .


PD :

Also, i recently converted Map of AoS Battle Builder From This:

image

To This :

image

Also,there's margin : image

So... i think i may add some water to maps that doesn't have it, because in the water spaces, voxlap skips it because of the simple formula of (S = E+1, so, E-S = -1 ; K = (E-S)+1 = 0 ; next_byte = 4*(1+(K)); Skip water if N=0 [TOTALLY CURIOUS NO? xD]) . And i can tell you that i found a way to get the maximum height of a map... it's useful to load AoS Battle Builder Maps :D ... So it means that my version could sup the maps of AoS Battle Builder & maps of Workshop in steam :D , so it will support any maps of any version :O . So i'm seriously working in it, because i think, that if i work harder, it will be the good part of both worlds :D .

Edgamer63 commented 5 years ago

Well, i already found a way to do it... and it was tricky xD , now i will do the bitwise operations, for prepare the vertex graphics and see if the World Engine will be working soon(With capacity to load AoS Battle Builder Maps too) :D , so... Thanks :D