Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (monarch), 1,259 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 4 1 2 3 4
Re: How to: tiles in 3dgs [Re: Joozey] #378716
07/25/11 21:44
07/25/11 21:44
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
i didnt read the last like 4 posts, but what about making some clumped prefabs.... like if an area has a square of like 9 of the same tiles, make 1 tile the size of 9 with 9 small tiles in it. the math shouldnt be too hard i dont think.

Re: How to: tiles in 3dgs [Re: lostclimate] #378721
07/25/11 22:12
07/25/11 22:12
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
How about one relatively low-res bmap (obviously at something less than 32 bits per pixel) and use a shader to render the tiles over each pixel?

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: How to: tiles in 3dgs [Re: JibbSmart] #378724
07/25/11 22:48
07/25/11 22:48
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
In the end draw_quad still appears to slorp down to 15 fps. And I now have the disadvantage not to be able to draw panels in front of the level.

I guess clumped prefabs also requires a lot of calculating to determine where the clumps are, and again when a tile in the prefab is destroyed. But since there are large spots of ground that are all the same, may be a solution. It's just a downside that the fps goes down when you dig more pathways in the screen... unless the pathways are bitmaps in front of the tiles... hm...

Not sure about a shader, never fancied them as they tend to make my laptop cry (no matter how simple they are), and only used premade shaders thus far. I have no idea where to start writing a shader that puts tiles on pixels of a lower scaled bitmap generated from a noise function. I guess it's like using an array and bmap_blit, but somewhat faster?


Click and join the 3dgs irc community!
Room: #3dgs
Re: How to: tiles in 3dgs [Re: Joozey] #378727
07/25/11 22:57
07/25/11 22:57
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
The best approach would probably bmap_blit... Your problem is the high amount of draw calls, as each quad is rendered seperately and the parameters and stuff are probably all seperately updated. And while the bmap_blit itself won´t be extremely fast, it shouldn´t cause any problems as long as don´t change all tiles each frame. The resulting bitmap can than be rendered in just one draw call...
Another alternative not directly possible with gamestudio would be geometry shaders. The possible solution which is similar would be to prepare a mesh with the maximum number of quads you need and do some vertex manipulation on it to set positions and texcoords in an atlas texture. The last thing would probably be the fastest solution with gamestudio, but bmap_blit should be a bit easier to realize and perform good enough.

Re: How to: tiles in 3dgs [Re: Slin] #378730
07/25/11 23:03
07/25/11 23:03
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline OP
Expert
Joozey  Offline OP
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
^ and when moving around I could simply bmap_blit that image, minus the row or column that I move from, and only update that part. Let's see how that performs.


Click and join the 3dgs irc community!
Room: #3dgs
Re: How to: tiles in 3dgs [Re: Joozey] #378737
07/25/11 23:28
07/25/11 23:28
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
If you had access to video memory, I could give you some extremely fast tile map drawing code I once wrote. It would give you at least 60 FPS as well as scrolling if you wanted it, and you wouldn't have to mess with updating only a few tiles per frame...


Eats commas for breakfast.

Play Barony: Cursed Edition!
Re: How to: tiles in 3dgs [Re: Redeemer] #378741
07/26/11 00:42
07/26/11 00:42
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
But shaders solve everything frown Ever. Forever.

Jibb


Formerly known as JulzMighty.
I made KarBOOM!
Re: How to: tiles in 3dgs [Re: JibbSmart] #378759
07/26/11 11:40
07/26/11 11:40
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
the geometry shader approach also came to my mind. but you can strip that down to a pure vertex shader approach. just prepare the mesh for all quads and then do a texture lookup to check which texture should be drawn; changing blocks then works via pixel_to_bmap.

Re: How to: tiles in 3dgs [Re: Joey] #378763
07/26/11 12:15
07/26/11 12:15
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
I did a test rendering using simple pixel shaders some time ago.
This way you can fill your whole screen with multible layers of tiles at very high frame rates.
I see no reason not to use shaders even if you create something old-schoolish.

Re: How to: tiles in 3dgs [Re: Hummel] #378767
07/26/11 12:40
07/26/11 12:40
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
I do see it as an overkill wink
Slin's method of using bimap blitting looks more suitable I guess. Just use the blitting and erasing only when needed(even if you are going to do it on multiple tile, do it once at a time, spread the load), and there should be no slowdown.

Page 2 of 4 1 2 3 4

Moderated by  checkbutton, mk_1 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1