Author |
Message |
|
Dark
Newbie
Joined: 06 Jan 2004 Posts: 11
|
Posted: 30 Mar 2004 10:18:44 pm Post subject: |
|
|
Nice to meet you all again... I have been on this site... but it was a long time ago... Anyway Im halfway through one of my projects on my calculator (Just finished a complex ping pong type game) Have any of you played the MS-Dos supported Mag/Rogue/Hack game... Basically for you guys who havent played it is a simple randomly generated dungeon venturing game where you obtain items, fight off monsters (Axebeak=a Queensnake=Q) Which are represented by letters. It was one of my favorite time consuming games so I decided to try and make it... So far i havent run into any difficulties (Doing it with basic programming on calc) except How exactly to generate different dungeon rooms randomly. (It sounded easy to me, but i cant figure out how to get it to always have the rooms connected by random hallways and to have them not over lap and stuff...) So since im pretty new to the programming I need help plz... What exactly would i do?
Thank you, Dark |
|
Back to top |
|
|
Missin2rideWS
Newbie
Joined: 26 Mar 2004 Posts: 36
|
Posted: 31 Mar 2004 12:23:22 am Post subject: |
|
|
oooooo k ive never seen the game but ill explain some stuff to ya you know how to make randoms rite?
Code: :round(rand,a)*whatever
that will round the rand value (which is alway in between 0 and 1) to a cirtain deciaml place (a=2 would end up like 0.64) you can multiply it to get nice clean random intergers
okto make the dongeon you would star out with an imaginary grid lets say each block is 10 px wide and tall so youd hav about 9 x 6 or sumthing
you would also need to astablish a way of storing this dongen somhow. (you could use a matrix if they werent so fuckin inneficient lol its like 11 bytes per number!!) but ya you could use a matrix and each block has 2 walls storing only the bottom and right wall for each one (the top and left walls are the bottom and right walls of the next-door-neibor blocks) ooo kkkkkkk uhmm like 4 possibliities for a block:
_ | _| open, bottom only, right only, both so 1 2 3 4 and anyhintg behind the decimal could represent item in that block
ok now that you have a way to store it you need a way to generate it.
set all blocks to 0 with 0*[A]->[A] and start at the starting spot (its probably top-left block right?) what i mean by start is do a 0->X and 0->Y then inspect all the blocks around the current one to see if they have been visited or not (if they havnt theyl still b 0) you can do that but checking the matrix at [A](x+1,Y) which would be the one to the right for exapmle.
after figureing out how many directions are avilable and which ones they are, (i would temporerily store this in a list which you could find the length of) if north, south and west were available the list would be {1,3,4} get it? you need to randomly pick one
Code: L1(int(dim(L1)rand)+1)->D
that will return a random available direction stored in L1 (dim(L1) is the length)
once that direction has been picked, set all the walls in that block to closed exept the one you left through. since it picked south, block 0,0 will be set to 3 witch is bottom open; right closed. you dont need to worry about the top and left ones because those blocks will eventually be visited and all walls will be closed exept the ones it will move out of and it cant move out of that one and into this one to it WILL close
then GO south by adding 1 to Y (remember that i put the origin it the top left, but you can change that how you see fit) and repeat back at the neibor checking step
do that for every block until its done. the finishing place can be any block with the "finish" item in it. there will be 3 problems that arise.
1:dead ends - when a dead end is found figure out some way to jump to a random visited block and branch off from it changing its stroed wall value accordingly
2: going north or west - when you go into the new block and get to the part where your storing the walls take the direction you came from into account. (this will be overwritten when you radomly geterate D so put in line of code right before that backs up D into like M or something like D->M. M will now be the direction you left the previos block going.
3: whenever your checking the matrix values you need to make sure you DONT check the ones that are off the edges of the map so that thay dont get recorded as possible directions, which in turn would prevent the generator from moving outside the range of the matrix.
one other thing dont use X or Y ..... or Z or A they change alot for no reason because they suck
if you need any mor help im on like every day
FEELS GOOD TO ANSWER A ? INSTED OF JUST ASKING THEM!! |
|
Back to top |
|
|
Missin2rideWS
Newbie
Joined: 26 Mar 2004 Posts: 36
|
Posted: 31 Mar 2004 12:48:42 am Post subject: |
|
|
it doesnt have to be a grid shaped dongeon though. you could use that data to make a lost woods (from ocorina of time) type thing. and instead of not letting you go throught closed wall it would just send you back to start if you went through one |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 31 Mar 2004 02:22:40 pm Post subject: |
|
|
http://forums.unitedti.org/index.php?showtopic=1109
Quote: round(rand,a)*whatever
that will round the rand value (which is alway in between 0 and 1) to a cirtain deciaml place (a=2 would end up like 0.64) you can multiply it to get nice clean random intergers Use the randint statement instead.
As for random map generating, just start out with choosing how many rooms, then where they are located, then how big they are, then how they are connected, and eventually place objects in them, shouldn't be too hard.
Quote: okto make the dongeon you would star out with an imaginary grid lets say each block is 10 px wide and tall so youd hav about 9 x 6 or sumthing I like 6x6 because a signle text( statement will erase an entire tile.
Quote: you would also need to astablish a way of storing this dongen somhow. (you could use a matrix if they werent so fuckin inneficient lol its like 11 bytes per number!!) Use lists for permanent data (character file) and strings for temp data (rooms). You can use a seed to generate the rooms so you won't need to store all the rooms permanently.
Example:
3->LSAVE(4 //floor #
45687->LSAVE(5 //seed for world
LSAVE(5->rand //use seed
For(X,1,LSAVE(4 //randomizer offset loop
rand
End
//generate current map here
Quote: set all blocks to 0 with 0*[A]->[A] Just 0[A]->A will work.
Quote: you can do that but checking the matrix at [A](x+1,Y) which would be the one to the right for exapmle. You mean [A](Y,X+1)
Good luck.
Last edited by Guest on 31 Mar 2004 02:30:54 pm; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 31 Mar 2004 04:57:41 pm Post subject: |
|
|
Missin2rideWS wrote: you would also need to astablish a way of storing this dongen somhow. (you could use a matrix if they werent so fuckin inneficient lol its like 11 bytes per number!!)
Just a few comments :
1. It is hard to read something with so many spelling errors. Please try to correct this in later posts.
2. Do you think swearing makes you look cool or sexy? Because I know for a fact girls hate it when guys swear (they think it is stupid [most do anyways]).
3. It is 9 bytes per number to be exact, plus 2 bytes signifying matrix size, then on top of all that, there is the name and variable information which adds even more bytes. |
|
Back to top |
|
|
Dark
Newbie
Joined: 06 Jan 2004 Posts: 11
|
Posted: 31 Mar 2004 05:59:16 pm Post subject: |
|
|
Okie... That helped a lot... Thx |
|
Back to top |
|
|
b__
Member
Joined: 16 Jun 2003 Posts: 173
|
Posted: 31 Mar 2004 06:04:11 pm Post subject: |
|
|
Not to discourage you, but there is already a rouge game on ticalc.org. Its a flash app. |
|
Back to top |
|
|
Missin2rideWS
Newbie
Joined: 26 Mar 2004 Posts: 36
|
Posted: 31 Mar 2004 07:09:14 pm Post subject: |
|
|
Arcane Wizard wrote: Quote: you would also need to astablish a way of storing this dongen somhow. (you could use a matrix if they werent so fuckin inneficient lol its like 11 bytes per number!!) Use lists for permanent data (character file) and strings for temp data (rooms). You can use a seed to generate the rooms so you won't need to store all the rooms permanently.
Example:
3->LSAVE(4 //floor #
45687->LSAVE(5 //seed for world
LSAVE(5->rand //use seed
For(X,1,LSAVE(4 //randomizer offset loop
rand
End
//generate current map here
random seed huh i could use that for so many or my progs... thanx man
ps sry about droppin the f bomb wiggins |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 31 Mar 2004 10:02:04 pm Post subject: |
|
|
Missin2rideWS wrote: ps sry about droppin the f bomb wiggins
Its fine, just please TRY to refrain. This is a nerd board, and I am sick of tolerating the crap that is put on it. :lol:
;)
Jbirk, I have been asking if a personal filter is possible for Months! (since you removed the old filter actually...) Is it possible? |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 01 Apr 2004 05:49:48 am Post subject: |
|
|
Yes it's possible, and quite easy to set up too. But forum policy is that swearing is allowed but frowned upon.
Quote: random seed huh i could use that for so many or my progs... thanx man Glad to help.
BTW, you stated:
Quote: one other thing dont use X or Y ..... or Z or A they change alot for no reason because they suck But, I know of nothing that changes X, Z, or A without you wanting them to change (ie 1->A) and the Y variable is changed if you use the graph screen.
What I do:
Upper variables (A,B,C,D,...) for throughout the game stuff (cursor position and such), lower variables (X,Y,Z,Ø) for misc stuff like for loops. |
|
Back to top |
|
|
Dark
Newbie
Joined: 06 Jan 2004 Posts: 11
|
Posted: 01 Apr 2004 05:43:46 pm Post subject: |
|
|
Is there really a rogue game out there already...
Where can i find it
I will still continue making my version of it though
Maybe it will be better |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 02 Apr 2004 11:24:14 am Post subject: |
|
|
www.ticalc.org and look in the assembly archives. |
|
Back to top |
|
|
Keith Pierce
Advanced Member
Joined: 02 Feb 2004 Posts: 411
|
Posted: 02 Apr 2004 12:17:13 pm Post subject: |
|
|
What type of game is rouge? RPG, Action? |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 02 Apr 2004 05:02:13 pm Post subject: |
|
|
Action RPG. : ) Or hack and slash roleplaying game, whatever term you prefer. |
|
Back to top |
|
|
|