Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Tile compression algorithm for my level maker

Author
Message
TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 20th Jun 2008 14:39
Hey guys!

I have made this level maker to make life easier for me, but yet, it doesn`t speed up! Of course not, because it has 1922 polygons! The level maker has these tiles(31*31) that you can move up and down, and then you can cover the spaces with triangles.

So, to compress the level a bit, you need to make less triangles. Instead of filling a flat space with tons of triangles, you should only need to use two. How can I make the program fill the space with two triangles(to form a square), if the grids between them are all the same height?

Thanks, TheComet

PS:I`ll post some code later, I`m in a great rush!

Oooooops!!! I accidentally formated drive c.
master programmer
20
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 25th Jun 2008 08:57
By tiles do you mean on a matrix or are you doing this 2D?

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Jun 2008 09:09
@master programmer

Non of the two you mentioned: It`s 3d, just like a matrix, only I don`t use the "make matrix" command, I fill the spaces with triangles with "make object triangle"

TheComet

Oooooops!!! I accidentally formated drive c.
master programmer
20
Years of Service
User Offline
Joined: 30th May 2005
Location: 3D Space
Posted: 25th Jun 2008 09:11
So you could use the mouse to detect the position of the screen in 3D space so when the mouse is clicked it fills an individual triangle. There are some code examples on here that allow the mouse to have a 3D object follow it in 3D space, as well as calculate the position of the mouse in 3D.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Jun 2008 09:15
Quote: "There are some code examples on here that allow the mouse to have a 3D object follow it in 3D space"


Yes, I wrote one of those.

That is a good idea, yet I wan`t it to be automatic and officient.

I`ll try to do that, thanks, TheComet

Oooooops!!! I accidentally formated drive c.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 27th Jun 2008 00:51 Edited at: 27th Jun 2008 00:54
@TheComet
If you are using 1.20 you should have access to memblocks. I've made several object creation functions, some using triangles and some using vertice calculations and memblocks, and the memblock method is always much faster (and flexible - you can control the UVs as well!)

A user named Kelebrindae has made a series of functions to create an object with the properties of a matrix. You can find a link to this library in the sticky 1.20 commands explained at the top of the board. Matrix to Mesh

If you choose not to use his functions directly, you might look through the code to see how he used the vertices to create a matrix mesh. You could adapt the principals to your tile editor and speed it up (making individual triangle objects is sloooowwww with high polys).

Enjoy your day.

Login to post a reply

Server time is: 2025-06-06 00:19:59
Your offset time is: 2025-06-06 00:19:59