Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Zelda dungeons without alot of rooms  (Read 2996 times)

0 Members and 1 Guest are viewing this topic.
Zelda dungeons without alot of rooms
« on: January 29, 2012, 12:55:12 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
Hello, im peicing together my first dungeon and i was wondering if there is a way to have one big room, like an overworld area(easier level setup, less rooms, less tiling, ECT.) but have it set up so views make it seem like one seperate room. whereas if the view hits a wall/border/whatever, the view stops scrolling. so i can just make one huge room, but in retrospect it will seem like many. the problem with this is how to make the views behave accordingly, i have the thought out, im just not sure how to code it at all. heres my thoughts on this, let me know your input on whats good on this, or suggestions or something
setup one big room, and have a regular view like normal.
have an object or barrier that catches the view, returns a variable or something and then stops the view from scrolling in that direction if you are a certain length away. if you go through a door, the view turns into a different rooms view, where the same process happens.. but is this possible without creating tons and tons of views? and there are only 8 views anyways so its not even going to work like that.. does anyone have any suggestions? should i just make a bunch of seperate rooms(that leads for more trouble then finding out how to do this.. plus it would make dungeons only be like 2-3 screens depending on how many floors there are. it would make alot easier if i could figure it out..)
Logged
Re: Zelda dungeons without alot of rooms
« Reply #1 on: January 29, 2012, 02:00:29 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
A simple suggestion would be to do it similar to Link's Awakening.  The view only moves 144 pixels(the width of the screen)horizontally and about 144(I believe) vertically.  So you could create an object that the view always follows.  Everytime you come to the edge of the screen, it activates that object to move in the desired direction.  Once it goes 144 pixels total, you stop that object and reset it.  During this movement, Link also moves a few pixels so as to keep him away from the edge so that you do not get stuck in a loop.

If you would like, I could throw together an example in GM 8.0 lite for you to look at.
I actually just remembered after posting that I have a gmk of my old Myth of Heroa project that uses this.  it is based upon the original Zelda's dimensions but could be adjusted accordingly to suit your needs if you want to check it out.
« Last Edit: January 29, 2012, 02:02:19 am by Theforeshadower »
Logged
  • Super Fan Gamers!
Re: Zelda dungeons without alot of rooms
« Reply #2 on: January 29, 2012, 02:05:42 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
Thanks for the responce! Didnt know i was going to get one so fast. Do the rooms all have to be the same size for that to work? And is that code easy to impliment(some codes might be buried deep into it and need tons of other features for it to work..) but i would love to check out your engine anyways.
Logged
Re: Zelda dungeons without alot of rooms
« Reply #3 on: January 29, 2012, 02:13:02 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
For my engine, the rooms are all the same size.  it is based upon a scrolling system like Legend of Zelda and Link's Awakening where each room is scrolled through but all the rooms are actually inside one giant room.  Everything outside the view is disabled so that the code for those objects are run if you are not in the respective rooms.

Anyway, I am posting the old GMK.  It requires PRO to run however you can load it up and look at the code.  It's not very well commented and probably has some flaws, but feel free to ask questions.

What you want to look at is the obj_scroll code and obj_hero Begin Step code.

If you do use my code, I would appreciate the credit for it since I did work quite a bit on this project even though I never finished it.
Logged
  • Super Fan Gamers!
Re: Zelda dungeons without alot of rooms
« Reply #4 on: January 29, 2012, 02:18:45 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
Just looking at the scroll code gave me an idea. would something like this work? or would it not be efficient/good..

if x > view_xview[0] + maxroomwidth
{
view_xview[0] = 248
}
and in every doorway there is a little object that if you hit it it makes maxroomwidth = something else.. and i would try this for all 4 directions. do you think it would work? would that accomplish my goal? also i think those have to be global variables..

EDIT: i was thinking something like this.. any comments?
////////////////////////
if x > view_xview[0] + global.xmaxroomwidth
{
view_xview[0] = global.xmaxroomwidth
}
////////////////////////
if x > view_xview[0] + global.xminroomwidth
{
view_xview[0] = global.xminroomwidth
}
////////////////////////
if y > view_yview[0] + global.ymaxroomwidth
{
view_yview[0] = global.ymaxroomwidth
}
////////////////////////
if y > view_xview[0] + global.yminroomwidth
{
view_yview[0] = global.yminroomwidth
}
//////////////

in a collision with something code

global.xmaxroomwidth = xmax
global.xminroomwidth = xmin
global.ymaxroomwidth = ymax
global.yminroomwidth = ymin

and in the creation for each of those put stuff for xmax and all that.
« Last Edit: January 29, 2012, 02:33:14 am by Whitay »
Logged
Re: Zelda dungeons without alot of rooms
« Reply #5 on: January 29, 2012, 02:32:50 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
What you are doing there just teleports the view, which doesn't really fit with a Zelda game.  You could that in a way, but you would have to have a different scroll object for every dungeon that kept track of every single scroll point.  Like, if you had 9 rooms  set up like a cube you would have to program 24 points where the view changes.
The only other way to do it without making a new object for each dungeon would be a switch call that is based upon each dungeon which would be stored in a global variable:
This is psuedo code so it may not work directly

switch global.dungeon
{
      case 1:
            {put all your view points here for dungeon 1}
      case 2:
            {put all your view points here for dungeon 2}
      case 3:
            {put all your view points here for dungeon 3}
      and so on...
}

If you have rooms of different sizes, you could try two view objects.  The scrolling one would always follow the regular view while moving in a big room.  When you go through a door, the scrolling one takes over and the regular view would follow it until the scrolling view was finished scrolling.


Hope that makes sense.
Logged
  • Super Fan Gamers!
Re: Zelda dungeons without alot of rooms
« Reply #6 on: January 29, 2012, 02:41:12 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
uhm... yeah i understand the first part but starting with the code im confuzed. can you maybe go in detail more?
Logged
Re: Zelda dungeons without alot of rooms
« Reply #7 on: January 29, 2012, 02:45:17 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
You should just post your project gmk so I can see what you want to accomplish exactly.  From there, I could give you more concise code.  Or just post a picture of your base dungeon with some words/scribble that shows me exactly how you want the rooms to be scrolled through with the view.
Logged
  • Super Fan Gamers!
Re: Zelda dungeons without alot of rooms
« Reply #8 on: January 29, 2012, 02:53:16 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
Im probably just going to stick with many small rooms.. but ill just explain it with a simple screenshot below, since the dungeon isnt tiled and theres alot of still in progress and such, since im not done with it, so i used an area i am done with to help explain it. heres how it goes

If you are within that black box, your view will stop at the end of the box, so you dont see past it, so you wouldnt see anything that is inside the yellow or Red boxes. now if you go up, and go into the red box, all you would see is the red box, no black or sides. now im not sure how great this idea will be. while it being a good idea for overall design, and some coding, it seems like it would be pretty hard to set up.. but i really dont want to make a bunch of seperate rooms. is there a way to accomplish this without having like 500 view change objects every 5 feet..?

Logged
Re: Zelda dungeons without alot of rooms
« Reply #9 on: January 29, 2012, 03:06:39 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
So what I gather is that you are basically wanting a system similar to A Link to the Past.
Here's one way you can go about doing this:
In the Step event of your view object(you should really have a view object), have it always follow Link if the conditions are met-
link.x > leftedge(would be a number variable)+ half your screen resolution width && link.x < rightedge - half your screen resolution width && link.y > topedge+ half your screen resolution height && link.y < bottomedge - half your screen resolution height

If those considitions are met, then the view would always follow Link.

If one of those conditions are broken such as:
else if link.x > (rightedge) then scroll to the right with your view object about the width of your screen.  Remember to move Link to the right(or the scroll direction) a few pixels as well so that you are not caught looping between left/right or up/down.
Logged
  • Super Fan Gamers!
Re: Zelda dungeons without alot of rooms
« Reply #10 on: January 29, 2012, 03:16:45 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
Yes. thats what i was pretty much going for. LTTP style, but i want it in one huge room(is that how LTTP did it?) and no i dont have a view object.. haha:P but that plan seems like it should work.. but im not sure how that would put together with all the rooms.. like how would leftedge and stuff be changed? im thinking of just going with tons of little rooms as of now.. because while it would work it doesnt seem very efficient..
Logged
Re: Zelda dungeons without alot of rooms
« Reply #11 on: January 29, 2012, 03:23:08 am »
  • *
  • Reputation: +12/-2
  • Offline Offline
  • Gender: Male
  • Posts: 4849
Actually, making a bunch of small rooms is in-efficient in a way as it will make your filesize a lot larger than it needs to be.
Logged
  • Super Fan Gamers!
Re: Zelda dungeons without alot of rooms
« Reply #12 on: January 29, 2012, 03:26:35 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
but using the code above would take alot more time because first i would have to think of a glitch proof code and then every time you go to a new room i would need an object that changes variables and stuff..
Logged
Re: Zelda dungeons without alot of rooms
« Reply #13 on: January 29, 2012, 07:36:22 pm »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 269
EDIT: after about 10 minutes of slowly tweaking i have a solution. but a new problem then comes up..
Code: [Select]
if abs(Wall.x-x) <140
{
global.xstop = true
}


if abs(Wall.y-y) <100
{
global.ystop = true
}


if abs(Wall.x-x) >140
{
global.xstop = false
}


if abs(Wall.y-y) >100
{
global.ystop = false
}

in some object
Code: [Select]
if global.xstop = true
{
view_hspeed = 0
}

if global.ystop = true
{
view_hspeed = 0
}

if global.xstop = false
{
view_hspeed = -1
}

if global.ystop = false
{
view_hspeed = -1
}

But if i do that.. the room transition is very messed up. Let me explain with this picture. okay. in the seperare rooms(red and black) the views work great, everythings normal. you dont get to view the portion of the yellow box inside of the red box if your in black, and the other way around. but if theres a "Doorway" there and i walk through it, i cant see anything until i EXIT the yellow box, making the view follow me again. i was wondering how to fix this, and thought of a solution, but have NO idea how this is going to work. have a little shadow or some invisible block that if you touch it does a zelda room transition(even though you arent going anywhere) and then at the end of it transports link to the block, which would be placed in doorways. so you get your zelda transition, and then your in the doorway. but im not sure if this is an easy way to go about it or if this is the way to go through with it..


EDIT:
heres how rooms transitions should be done, if youve never seen LTTP, or you just want to look closer. ive played it, and closely looking at them actually helped a bit to get the actual views down. skip a few mins into the movie to see a dungeon, im not sure how to do this. any advice would be great.
http://www.youtube.com/watch?v=d4OnVBswiF8
because the rooms actually look sort of spread out,  with spaces in between. im sure that has something to do with the views changing...


ah crap. hit reply and not edit. sorry. ive gotten no sleep this week. hah:P
« Last Edit: January 29, 2012, 07:40:49 pm by Whitay »
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.07 seconds with 65 queries.

anything