
-----------------------------------
.hack
Thu Apr 22, 2004 8:31 am

RPG Walls..Collison Detection?
-----------------------------------
I'm making an RPG for ym school project..not a text based RPG, but an actual GUI RPG (like Final Fantasy 2, FF3, Chronot Trigger etc). I need some way of mapping (Photoshopto build the map) but I need it so that the character CANNOT move thru walls.

How should I do this. I thought of a background fill where u acn't walk on it, but it would engulf the entire map. Suggestions are most appreciated.


.hack

-----------------------------------
Flashkicks
Thu Apr 22, 2004 8:38 am


-----------------------------------
The only ways I know of detecting for walls is using whatdotcolor commands; but I dont know if that is wut you are particularily looking for with your proggy :? ..lol..  [by whatdotcolor I mean checking for Colors that lie InFront of you...]

-----------------------------------
.hack
Thu Apr 22, 2004 8:43 am


-----------------------------------
yea I was thinking about whatdotcolor, but it wouldn't work seem how that wall colors would be the same.. I couldn't use black as an out line for the wall, cause black is too commonly used.

I was htinking of drawing a "frame" around my map using tring commands, then makig them completely opaque, and using an obscure cure liek Magent, at 0% Opactity so its invisible. Would turing still beable to detect the dot color as Magenta even thos its invisible?

-----------------------------------
Flashkicks
Thu Apr 22, 2004 8:47 am


-----------------------------------
If Turing is as good as I KNOW IT IS[lol] it definately should..  if not- then maybe Tony could help you- he even has a whole Lesson on it..  Maybe you should read that- id put the link to it here but class is done and i g2g :shock:

-----------------------------------
Delta
Thu Apr 22, 2004 9:23 am


-----------------------------------
ya... ummm... as far as I know... and this help file I have here... it doesn't even allow you to make images transparent... but maybe this version is just out of date. But ya... I say with walls... have a completely coloured area outside of the map... all black or something... I'm not sure if you understand because I'm horrible at explaining things... but ya... if you private message me I'll send you a picture of what I mean...  or you could (more lines of code but just  as effective) use if statements...

if playerX < 100 then
playerX += 10
end if

Hopefully that helped :S

-----------------------------------
Flashkicks
Thu Apr 22, 2004 9:33 am


-----------------------------------
:shock: Thats a lot of If's :shock: ....

-----------------------------------
Andy
Fri Apr 23, 2004 10:15 am


-----------------------------------
what you could do is draw the walls in some weird color then mask it ovr with your real wall, then when u check for collision detection, use whatdotcolor on the monocolored walls, by drawing that in the offscreen, then pasting ovr ur real walls and then View.Updated. ofcourse you'll have to set the screen to offscreenonly by View.Set("offscreenonly")

-----------------------------------
AsianSensation
Fri Apr 23, 2004 11:06 am


-----------------------------------
OR, instead of using whatdotcolor, you could have a textfile like this:

0000000000
1110000000
1110000000
1100000000
1111000000
1111111110
1111111110

where 0 is spaces you could pass through, and 1s are the spaces you can't.

The benefit of this is that it's better then whatdotcolor in terms of speed and efficiency. And it would always give you the correct detection, assuming you scaled it right. Where as whatdotcolor is not that accurate if you have colors that are very close to each other.

The bad part of this is that you have to make a customize txt file for each one of your map that you plan on using. So if you have alot of maps, it's alot of work.

-----------------------------------
zylum
Fri Apr 23, 2004 1:09 pm


-----------------------------------
im pretty sure most rpgs are made with tile based worlds so you may want to look into that... basically you have an imaginary grid with your picture ontop of it... and as asiansensation said have a text file for where the user can or cant go or just assign each type of tile a different number 

eg: 0 for normal ground
1 for wall
2 for higher ground
3 for slope that leads to higher ground
4 water (cant go through)
5 for marsh and character walk/run speed slows down

etc...

and each grid size would be as big as the thickness of your walls or w/e

here's a simple example that just has walls... choose random as map type unless you want to make one yourself:

http://www.compsci.ca/v2/viewtopic.php?t=3883

(check the last post on the first page)

-zylum

-----------------------------------
Dan
Fri Apr 23, 2004 1:31 pm


-----------------------------------
i worte somting up about this awhile ago but where :think: 

any how title system whould deftely be the best way to do things.


Edit: i just looked for it and it is at the bottom of this turorial:

http://www.compsci.ca/v2/viewtopic.php?t=2524

it is a good read for poleop making rpgs

-----------------------------------
.hack
Tue Apr 27, 2004 6:17 am


-----------------------------------
Alrighty Gus and Girls, thanks for all the help. I'm convinced that a tile method would be the easiest.

After I'm done the mapping its pretty much smooth sailing, jus writing up procedures etc.

-----------------------------------
.hack
Tue Apr 27, 2004 11:16 am


-----------------------------------
ALrigty, I'm only making a short demo,a s this is my final project, so I'm making arrays for Monster types, then labelling them as part of an array, then commetning above their name etc, you'll see. ANyways for some reason Monster (1).charHP := 9 gives me an Assigned Value Wrong Type error. And I'm not sure why, it worked in the first Monster Array Cell, and the Player record, just now it breaks. Check out the code.




type VarList :
    record
        charName : string
        charStr : int
         charHP : int
         charMP : int
         %(about 50 more variables listed Underneath, just not spamming the post with them)

 end record


%Arrays
var Monster : array 1..50 of VarList
var Boss : array 1..50 of VarList
var Overlord : array 1..50 of VarList    

%Monster 1 = Hell Rabbit
%Monsters Stats,Some Are Calculated During Battle Procedures
Monster (1).charAP := 5 %.<

-----------------------------------
doey55
Wed Apr 28, 2004 9:02 pm


-----------------------------------
can u post ur whole program i would liek to check it out so far looking good man
