Mirage Source

Free ORPG making software.
It is currently Fri Apr 19, 2024 8:36 am

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1695 posts ]  Go to page 1, 2, 3, 4, 5 ... 68  Next
Author Message
PostPosted: Sun Feb 01, 2009 10:02 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Y-based sprite rendering!! Now 100% free!

Find;
Code:
Call BltPlayer


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/viewtopic.php?f=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?


Image


Top
 Profile  
 
PostPosted: Sun Feb 01, 2009 10:15 pm 
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.


Top
  
 
PostPosted: Sun Feb 01, 2009 11:32 pm 
Offline
Persistant Poster
User avatar

Joined: Fri Aug 15, 2008 3:11 pm
Posts: 633
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: :P
:mrgreen:

_________________
╔╗╔═╦═╦══╦═══╗
║║║║║║║╔╗║╔═╗║
║║║║║║║╚╝║║║║║
║╚╣║║║║╔╗║╚═╝║
╚═╩╩═╩╩╝╚╩═══╝


╔╦═╦╦════╦═══╗
║║║║╠═╗╔═╣╔══╝
║║║║║║║║╚═╗
║║║║║║║║╔═╝
╚═╩═╝╚╝╚╝ ?


Top
 Profile  
 
PostPosted: Mon Feb 02, 2009 12:25 am 
Offline
Knowledgeable
User avatar

Joined: Fri Feb 02, 2007 4:50 am
Posts: 263
Location: usa michigan centriville
:lol: thank you robin ^^.

_________________
Fuck? I really joined in 2006.
Spirea, Chat Rooms, Discussions, Help. everything you need in one spot.
http://spirean.com
I love my computer, you never ask for more, you can be my princess or be my whore


Top
 Profile  
 
PostPosted: Mon Jun 01, 2009 6:31 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
PostPosted: Tue Jun 02, 2009 3:47 am 
Offline
Persistant Poster
User avatar

Joined: Thu Mar 29, 2007 10:30 pm
Posts: 1510
Location: Virginia, USA
Google Talk: hpmccloud@gmail.com
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.

_________________
Nean wrote:
Yes harold. Give it to me.

Image
Image


Top
 Profile  
 
PostPosted: Tue Jun 02, 2009 8:06 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
PostPosted: Tue Jun 02, 2009 3:20 pm 
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.


Top
  
 
PostPosted: Tue Jun 02, 2009 3:54 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
PostPosted: Tue Jun 02, 2009 5:23 pm 
Offline
Regular
User avatar

Joined: Thu May 28, 2009 9:39 pm
Posts: 71
Location: Florida
When GIAKEN was a friend of mine, we were on his Asphodel test server and he had problems with the fringing.

_________________
I support pregnant women! (and Matts)
Image
Image
Image


Top
 Profile  
 
PostPosted: Tue Jun 02, 2009 5:26 pm 
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.


Top
  
 
PostPosted: Tue Jun 02, 2009 9:48 pm 
Offline
Pro
User avatar

Joined: Sun Aug 05, 2007 2:26 pm
Posts: 547
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.

_________________
GIAKEN wrote:
I think what I see is this happening:

Labmonkey gets mod, everybody loves him, people find out his code sucks, he gets demoted, then banned, then he makes an engine called Chaos Engine.


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 4:36 pm 
Offline
Regular
User avatar

Joined: Thu May 28, 2009 9:39 pm
Posts: 71
Location: Florida
I don't know where this goes O_o...... I tried searching for Call BltPlayer but all I find is Call BltPlayer(PlayersOnMap(i))

_________________
I support pregnant women! (and Matts)
Image
Image
Image


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 5:07 pm 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
Lol. You found it. Not everything tutorials tell you to find is going to be word for word.

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 8:37 pm 
Offline
Regular
User avatar

Joined: Thu May 28, 2009 9:39 pm
Posts: 71
Location: Florida
ugh it's so annoying though.

_________________
I support pregnant women! (and Matts)
Image
Image
Image


Top
 Profile  
 
PostPosted: Fri Jun 05, 2009 8:53 pm 
Offline
Persistant Poster
User avatar

Joined: Fri Aug 15, 2008 3:11 pm
Posts: 633
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.

_________________
╔╗╔═╦═╦══╦═══╗
║║║║║║║╔╗║╔═╗║
║║║║║║║╚╝║║║║║
║╚╣║║║║╔╗║╚═╝║
╚═╩╩═╩╩╝╚╩═══╝


╔╦═╦╦════╦═══╗
║║║║╠═╗╔═╣╔══╝
║║║║║║║║╚═╗
║║║║║║║║╔═╝
╚═╩═╝╚╝╚╝ ?


Top
 Profile  
 
PostPosted: Sat Jun 06, 2009 5:27 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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?


Image


Top
 Profile  
 
PostPosted: Sat Jun 06, 2009 5:31 pm 
Offline
Persistant Poster
User avatar

Joined: Fri Aug 15, 2008 3:11 pm
Posts: 633
yay

_________________
╔╗╔═╦═╦══╦═══╗
║║║║║║║╔╗║╔═╗║
║║║║║║║╚╝║║║║║
║╚╣║║║║╔╗║╚═╝║
╚═╩╩═╩╩╝╚╩═══╝


╔╦═╦╦════╦═══╗
║║║║╠═╗╔═╣╔══╝
║║║║║║║║╚═╗
║║║║║║║║╔═╝
╚═╩═╝╚╝╚╝ ?


Top
 Profile  
 
PostPosted: Sat Jun 06, 2009 6:29 pm 
Offline
Regular
User avatar

Joined: Thu May 28, 2009 9:39 pm
Posts: 71
Location: Florida
Alright. Sorry I probably have been asking stupid questions, I'm just new to programming in VB6.

_________________
I support pregnant women! (and Matts)
Image
Image
Image


Top
 Profile  
 
PostPosted: Sat Jun 06, 2009 7:46 pm 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
Ask all the stupid questions you want.

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
PostPosted: Fri Jun 19, 2009 3:51 pm 
Offline
Newbie
User avatar

Joined: Thu Jun 18, 2009 3:50 pm
Posts: 5
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
Code:
High_Npc_Index

and says

Compile Error
Variable Not Defined


Any Ideas ^.^
Sorry I'm just starting out with VB

_________________
Image
Image
(Un)Plugged


Top
 Profile  
 
PostPosted: Fri Jun 19, 2009 4:02 pm 
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


Top
  
 
PostPosted: Fri Jun 19, 2009 4:06 pm 
Offline
Newbie
User avatar

Joined: Thu Jun 18, 2009 3:50 pm
Posts: 5
Thank you so much :)
It Works now

_________________
Image
Image
(Un)Plugged


Top
 Profile  
 
PostPosted: Fri Jun 19, 2009 4:54 pm 
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.


Top
  
 
PostPosted: Wed Jul 22, 2009 9:01 pm 
Offline
Regular
User avatar

Joined: Sat Dec 08, 2007 11:16 pm
Posts: 25
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
Code:
Player(i).Y = Y


to
Code:
Player(PlayersOnMap(I)).Y = Y

_________________
Online Dragonball - 2D DX8 Role Playing Game


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1695 posts ]  Go to page 1, 2, 3, 4, 5 ... 68  Next

All times are UTC


Who is online

Users browsing this forum: wanai and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group