Since i can't sleep tonight (sunday) and it is now after 6am monday,
i was thinking about how Auto Tiles work.
I have a couple of half thought-out tuts that attempt to explain it but
they don't go far enough for me to understand the processes
involved to even begin a very small project like this.
I was just curious if anyone here has ever tried creating a tilebase
game map with auto tiling before.
I didn't post in your custom control thread because I didn't want to discourage you,
but in this post there is code, for Public Sub New(), to turn on doublebuffering:
' Load the picture into a Bitmap.
Dim bm As New Bitmap(file_name)
' Display the results.
picImage.Image = bm
picImage.SizeMode = PictureBoxSizeMode.AutoSize
Code for loading to an Image object (using that as a backbuffer),
and then DrawImageUnscaled painting to a panel control is also shown on this jo0ls post.
Personally I think flipping backbuffered graphics directly onto the form,
(with DoubleBuffered property set to true),
is just as valid as using controls so long as a Multiple buffering pipeline
is set up correctly offscreen.
Do you ever have a chance to play around with the
VB_Alien_MapMaker-rev_1_dot_1.zip
that surfR2911 posted as the last post in you tiles sheet thread?
There are a whole bunch of ways to do tile transitions:
1.) A "flip map" hop, with or without a tile map scrolling (1, 2)
2.) A 2D "shoots and ladders" type transition
3.) A teleporter pad (with round go-thru portal or flying pad, DungeonSeige-style)
4.) An alpha-blended transition stairway (like Diablo-style)
Speaking of which, if you look for the links to the old VB6 demo that
rpgnewbie did for alphablended transitioning of Diablo-style rpg graphics
most of the links are broken (because they used the old style thread urls).
Additionally rpgnewbie had trouble getting the whole thing up in one zip
because of the upload limitations (and frequent time-outs) of the forum back then,
so maybe I it's time to try and do a re-posting to restore the attachment to its whole condition.
It's a very humble demo, but it still has gotten over 1000 "views" for parts A & B combined,
meaning close to 600 people at least tried it out to date.
In terms of an alphablending demo, using rpg graphics, that is designed to show a transitioning:
"when you go inside a building or behind a pillar the game "fades out" the blocking wall/roof/pillar."
it's pretty much the best demo available,
even though it uses isometric tiling
(and of course for your purposes would need some VB.Net alphablending code
similar to what is going on now in posts #19, #22, & #25 of the Viewer thread).
Thanks for you reply hDC. I'm afraid i may have mislead
you in what i was talking about. Perhaps i used the wrong
wording.
What i meant by tile transition is, lets say you draw a 32x32 water tile
in the map, the drawing automatically draws the grass tiles all around the
water tile, like RPG Maker does. Now that i think about it, isn't that called
auto-tiles?
I'm sorry about the misunderstanding.
[Edit]
I changed the thread title and the post to reflex
more about what i was talking about.
Oh..auto-tiles.
Well that's a totally different thing.
So you basically want to automate the placing of tiles more
than the auto-fill tile routines in the last post in the tile threads cited above..
What type of A.I. criteria are you thinking of
for how this auto-tiling is to be done?
For instance - if you place a set of 4 water tiles then does the
grass tiles automatically get placed surrounding them?
Of are you thinking about being able to place a set of tiles as a
group..like a palace or a fort or group of village huts
and then have an "auto-fill wilderness" button to wrap different
forest and grass tiles around the center cluster of tiles.
At this point, i'm not sure of anything. I'm just trying
to pick some brains here to see if anyone has ever
attempted this in vb before. I've never seen it done
yet.
I don't think an A.I. would be used in this case but
maybe more like an algorithm. I'm just guessing though.
Much like RPG Maker, the tiles used as auto tiles would
probably be limited to about 4 maybe 5. Grass, water,
snow, forest.
I know this would be a heavy duty subject to try and explain
so it would be nice if anyone knows of any simple vb projects
that have tried to use this feature in game tiling or maybe a
tutorial somewhere.
That's all I got..I certainly haven't looked at the source code for RPGMaker to know
exactly how it works internally..but someone did try to create something called the: "RPG Maker 20XX Engine".
There is some auto tile code C++ code inside the "wcmapdraw.h" file here,
but this code seems more oriented to emulating the rpgmaker player (RPG_RT.exe)
than the editor.
The whole thing can be downloaded as a C++ solution here.
I've already seen most of what you posted, except for
a couple of links and those really made no sense to me.
I've seen the Code Project one before to. I really don't
understand what it is trying to tell me but maybe i should
just buckle down and study a little harder on it.
I'd like to eventually see a demo of auto tiling posted
here, either by me or someone else. I know there are
people wanting to know how this is done, but no one
wants to invest the time it would take to learn how to
do it from scratch....
This is going to be a big learning curve because, once
someone learns how to correctly draw the auto tiles,
then they will need to learn how to save the map a little
bit differently, unless the auto tiling is strictly an algorithm
process that happens as you load the map. I've got lots to
learn i guess.
I was trying my hand at auto tiling but i was stopped real
quick. The tiles that i am using are from RPG Maker VX.
The tiles in the editor are 32 x 32. When placing a tile in
the game map area:
1: Referring to the darker blue water tile that is automatically
drawn on a blank map, if you lay out some grassy area and then
right click on that dark blue water tile and place it on the grassy
area, the tile is not the same one you just copied.
2: After you lay a tile, a border is drawn around that tile. The
tile you layed is 32 x 32 and with the border, it's around a
40 x 40 tile altogether.
Question is, where did that border come from? I can't find any
tile that is bigger than a 32 x 32 and i have all the new VX game
tiles.
I'll attach 3 images of what i'm talking about.
The first image "Sample1" is a snapshot of the map editor drawing
area of the RPGMake VX. To the right are ocean tiles and to the left
are grass tiles. In the grassy area, you'll see two single drawings of
the ocean tiles. Looking at the bottom one, you can see the tile selector
square. It is 32 x 32 and then you see the border around that. Where did
the border come from?
The next image "Sample2" are all the water tiles, as seen in the editor.
The next image "TileA1" are the first set of the original tiles that come
with RPGMaker VX.
These are the only water tiles that the editor offers.
1: Referring to the darker blue water tile that is automatically
drawn on a blank map, if you lay out some grassy area and then
right click on that dark blue water tile and place it on the grassy
area, the tile is not the same one you just copied.
2: After you lay a tile, a border is drawn around that tile. The
tile you layed is 32 x 32 and with the border, it's around a
40 x 40 tile altogether.
Question is, where did that border come from? I can't find any
tile that is bigger than a 32 x 32 and i have all the new VX game
tiles.
Where did the border come from?, you ask..
Probably from something you are doing in you autotile code?
However since you haven't shown any code it's a mystery
as to exactly what in your code might be causing this..
It's not from his code, it's a screenshot from RPGMaker VX.
And I thought this effect is what you were referring to from the start.
When two dissembler tiles abut one another, code is run to auto generate texture to blend/blur the edges of the two tiles so you don’t have a sharp line transition between the tile edges.
There are a number of ways this can be done. One of the simpler is have pre-canned combo textures for all combinations that can be placed next to each other and painting that along the edge.
But if you have many combinations, rather than pre-generate and store all possible combinations, the border texture may be generated on the fly when the two tiles are next to each other by shifting and fading, portions of the tile along the edge.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
..the border texture may be generated on the fly when the two tiles are next to each other by..fading, portions of the tile along the edge
We are talking alpha fading - probably by the use of some color matrix code, right? Page 2 of the Viewer thread does have some alpha fading examples.
I hate threads that are mostly theoretically and don't have much in the way of code examples.
The CodeProject AutoTile link that hDC_0 linked to back in post #6 of this thread is not all theoretical though.
The author, Colin Vella, did post his tIDE code (even though it's not VB.Net code).
I wouldn't necessarily assume alpha fading.
I haven't read a lot of the links that closely, but I believe there are various techniques discussed that one may use, such as interleaving pixels, or manually combining the pixels through some other process.
Since it is already covered in the links, I wasn't going to speculate on any particular method.
__________________
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.
Ya. All the sample images came from RPGMaker VX. I haven't
done any coding yet. I can't code, if i know nothing of the
process, which is why i am here.
So maybe what passel is talking about is tile transitioning, at least
in part. This is a process that blends two different tiles (water to grass)
together, so that straight lines are removed. The tiles are feathered together
sort of.
The rest of it probably is like what passel described to. Auto-generated textures,
It's the only thing that makes sense.
There is a lot of tile shifting when using RPGMaker. That first water tile that i
supplied, has very little water in it but when you start placing them on grass
tiles, it creates more water with borders where they belong.
Maybe this project is best left to the experts. This is way over my head.
Thanks for the information guys. It really helped me understand how the process
of auto-tiling works.
Some how, i screwed up my post. I got the cart before the
horse, so to speak.
As you can see, i have already posted a zip file, that contains
the javascript source code that contains the rpg maker vx code
on how to do auto tiling.
I was hoping if someone that is able to, to please convert this
java script to c# or vb.net, if possible.
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET. subscribe