Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Y-based sprite rendering!! Now 100% free!
Find;
and replace both the BltPlayer block of code, and the BltNPC block of code with;
Code: ' Blit out players and NPCs
For Y = 0 To MAX_MAPY
For i = 1 To PlayersOnMapHighIndex
If Player(i).Y = Y Then
Call BltPlayer(PlayersOnMap(i))
End If
Next
For i = 1 To High_Npc_Index
If MapNpc(i).Y = Y Then
Call BltNpc(i)
End If
Next
Next
This removes the need for BltPlayerTop for larger sprites, and compliments my Dynamic sprite sizes! tutorial perfectly. You can find that tutorial via this link;
http://web.miragesource.com/forums/viewt...124&t=5047
Can use this tutorial freely in your game/engine, as long as you don't claim it as your own. That means you, Frozengod!
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Quote:Can use this tutorial freely in your game/engine, as long as you don't claim it as your own. That means you, Frozengod!
Rofl.
Quote:Can use this tutorial freely in your game/engine, as long as you don't claim it as your own. That means you, Frozengod!
ROFL
:lol:
:mrgreen:
:lol: thank you robin ^^.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Bumping for great justice.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
You actually need to convert a lot of stuff to Y-based rendering...IE there's a problem with fringe layers where if you walk under one and you're taller than 64 pixels, your head will go over the stump but under the tree part.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
GIAKEN Wrote:You actually need to convert a lot of stuff to Y-based rendering...IE there's a problem with fringe layers where if you walk under one and you're taller than 64 pixels, your head will go over the stump but under the tree part.
"I" need to convert it?
Y-based rendering on players is there to make it so you don't need BltPlayerTop or any of that crap.
It does it's purpose.
If you're creating maps which can't handle any sprites bigger than 32x32, that's your problem. Take the tutorial for what it is.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Robin Wrote:GIAKEN Wrote:You actually need to convert a lot of stuff to Y-based rendering...IE there's a problem with fringe layers where if you walk under one and you're taller than 64 pixels, your head will go over the stump but under the tree part.
"I" need to convert it?
Y-based rendering on players is there to make it so you don't need BltPlayerTop or any of that crap.
It does it's purpose.
If you're creating maps which can't handle any sprites bigger than 32x32, that's your problem. Take the tutorial for what it is.
I think he said "you" as a generalization. Meaning it towards everyone.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Matt Wrote:Robin Wrote:GIAKEN Wrote:You actually need to convert a lot of stuff to Y-based rendering...IE there's a problem with fringe layers where if you walk under one and you're taller than 64 pixels, your head will go over the stump but under the tree part.
"I" need to convert it?
Y-based rendering on players is there to make it so you don't need BltPlayerTop or any of that crap.
It does it's purpose.
If you're creating maps which can't handle any sprites bigger than 32x32, that's your problem. Take the tutorial for what it is.
I think he said "you" as a generalization. Meaning it towards everyone.
I don't see why everyone should. I can't think of many people who can't make a map which doesn't have fringing issues.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
When GIAKEN was a friend of mine, we were on his Asphodel test server and he had problems with the fringing.
Robin Wrote:Matt Wrote:Robin Wrote:GIAKEN Wrote:You actually need to convert a lot of stuff to Y-based rendering...IE there's a problem with fringe layers where if you walk under one and you're taller than 64 pixels, your head will go over the stump but under the tree part.
"I" need to convert it?
Y-based rendering on players is there to make it so you don't need BltPlayerTop or any of that crap.
It does it's purpose.
If you're creating maps which can't handle any sprites bigger than 32x32, that's your problem. Take the tutorial for what it is.
I think he said "you" as a generalization. Meaning it towards everyone.
I don't see why everyone should. I can't think of many people who can't make a map which doesn't have fringing issues.
It is Harold we're talking about. *shrugs* I dunno.
The reason Harold posted this was because of something I showed him (in the context of y-based rendering in asphodel). Here is what happens.
If you have a sprite that is over 2x the tile (32x32 tiles would mean a 65x65 sprite or above). You need extra information on the fringe tile to know where the "base" of the tiles are.
So if you have a tree, you would want the sprite to be drawn under it if the sprite is higher then the base, and above it if the sprite is lower then the base. To fix this problem, a mapper would have to "tell" the computer where the base was for each set of fringe tiles. This is tedious, and for the most part not needed. Giaken wanted to require this for all maps with asphodel, and thankfully I convinced him not to.
So this is not a major problem, but if people are using a tileset that has fringe parts (trees) that are longer then 1 tile in height (rmvx is fine, rmxp is a problem) you cannot use sprites that are larger then pic_y*2. Those sprites are usually only used for bosses though, so it is easy to make the boss map not include trees, or atleast npc avoid.
@Giaken, If you forgot our conversation about this, there is no real way to "fix" this problem without getting much more information from the mapper. It would be easier to do in an object based mapping system, but that is usually a pain to get started with (and is why many people don't use vbgore). So do not ask Robin to "fix" this.
I don't know where this goes O_o...... I tried searching for Call BltPlayer but all I find is Call BltPlayer(PlayersOnMap(i))
Lol. You found it. Not everything tutorials tell you to find is going to be word for word.
ugh it's so annoying though.
imma tell you something about robin.
he/she might post great features but they will not tell you how to do the whole thing. They will only get you to a certain point or they will leave stuff out just so you can learn how to do stuff. if you ask robin will most likely help you learn how to do it.
Posts: 2,742
Threads: 115
Joined: Jun 2006
Reputation:
0
Doomy Wrote:imma tell you something about robin.
he/she might post great features but they will not tell you how to do the whole thing. They will only get you to a certain point or they will leave stuff out just so you can learn how to do stuff. if you ask robin will most likely help you learn how to do it.
You're no longer an idiot in my eyes.
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?
Alright. Sorry I probably have been asking stupid questions, I'm just new to programming in VB6.
Ask all the stupid questions you want.
Rian Wrote:Ask all the stupid questions you want.
Well now you've just opened the door for me
Hmmm Okay So tell me where I've gone wrong because I definitely have
Replaced this
Code: ' Blit out players
For i = 1 To PlayersOnMapHighIndex
Call BltPlayer(PlayersOnMap(i))
Next
' Blit out the npcs
For i = 1 To MAX_MAP_NPCS
Call BltNpc(i)
Next
With This
Code: ' Blit out players and NPCs
For Y = 0 To MAX_MAPY
For i = 1 To PlayersOnMapHighIndex
If Player(i).Y = Y Then
Call BltPlayer(PlayersOnMap(i))
End If
Next
For i = 1 To High_Npc_Index
If MapNpc(i).Y = Y Then
Call BltNpc(i)
End If
Next
Next
Now Starting the game It Highlights
and says
Compile Error
Variable Not Defined
Any Ideas ^.^
Sorry I'm just starting out with VB
Replace:
Code: ' Blit out players and NPCs
For Y = 0 To MAX_MAPY
For i = 1 To PlayersOnMapHighIndex
If Player(i).Y = Y Then
Call BltPlayer(PlayersOnMap(i))
End If
Next
For i = 1 To High_Npc_Index
If MapNpc(i).Y = Y Then
Call BltNpc(i)
End If
Next
Next
With:
Code: ' Blit out players and NPCs
For Y = 0 To MAX_MAPY
For i = 1 To PlayersOnMapHighIndex
If Player(i).Y = Y Then
Call BltPlayer(PlayersOnMap(i))
End If
Next
For i = 1 To MAX_MAP_NPCS
If MapNpc(i).Y = Y Then
Call BltNpc(i)
End If
Next
Next
Thank you so much 
It Works now
Hyperion Wrote:Thank you so much 
It Works now
I suggest reading the code before you use it next time. Read both the code in the tutorial and the code in your source.
if i was you i would remove PlayersOnMapHighIndex, put it this way.
Your index = 2. Your the only one on the map so PlayersOnMapHighIndex = 1, the loop will only draw index 1 so you will not draw. Well thats what from veiwing the code in mirage. If im wrong let me know
EDIT
ok i just seen the playeronmap bit so i guess im wrong about that, but Robin i did think highly of you until now.
If Player(i).Y = Y Then TUT TUT your checking the I not playersonmap so if your the only one on the map your checking the position of Index 1 not nessesary your Index. so if you are the only one on the map and your index is 2 If Player(i).Y = Y Then will return 0 every time  as the PlayersOnMapHighIndex will be 1 so the loop will only check for 1
Change
to
Code: Player(PlayersOnMap(I)).Y = Y
|