Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JayPC

Pages: [1] 2
1
Programming / Re: Diagonal Hallways.
« on: August 24, 2011, 06:36:09 AM »
Most people just use Bresenham's Line Algorithm or similar.

http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm

Thanks!! Looks like it will work!

2
Programming / Re: Diagonal Hallways.
« on: August 24, 2011, 04:59:52 AM »
Sorry for the late reply My issue was creating the Hall


Code: [Select]
A * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * B


I need to make a Hallway from "A" to "B" by turning the * into .

Im looking to create a carveDiagonalHall() method that starts at 0,0 and then goes at a rate of X/Y to reach B

The game is only a Psuedo Roguelike and angled movement is allowed.

a 1/1 rate looks like

a 1/1 ratio


Code: [Select]
A . * * * * * * * * * * * * * * * * * * * * * * * *
 * . . * * * * * * * * * * * * * * * * * * * * * * *
 * * . . * * * * * * * * * * * * * * * * * * * * * *
 * * * . . * * * * * * * * * * * * * * * * * * * * *
 * * * * . . * * * * * * * * * * * * * * * * * * * *
 * * * * * . . * * * * * * * * * * * * * * * * * * *
 * * * * * * . . * * * * * * * * * * * * * * * * * *
 * * * * * * * . . * * * * * * * * * * * * * * * * *
 * * * * * * * * . . * * * * * * * * * * * * * * * *
 * * * * * * * * * . . * * * * * * * * * * * * * * *
 * * * * * * * * * * . . * * * * * * * * * * * * * *
 * * * * * * * * * * * . . * * * * * * * * * * * * *
 * * * * * * * * * * * * . . * * * * * * * * * * * *
 * * * * * * * * * * * * * . . * * * * * * * * * * *
 * * * * * * * * * * * * * * . . * * * * * * * * * *
 * * * * * * * * * * * * * * * . . * * * * * * * * *
 * * * * * * * * * * * * * * * * . . * * * * * * * *
 * * * * * * * * * * * * * * * * * . . * * * * * *B

a 1/2 ratio

Code: [Select]
A . . * * * * * * * * * * * * * * * * * * * * * * *
 * * . . . * * * * * * * * * * * * * * * * * * * * *
 * * * * . . . * * * * * * * * * * * * * * * * * * *
 * * * * * * . . . * * * * * * * * * * * * * * * * *
 * * * * * * * * . . . * * * * * * * * * * * * * * *
 * * * * * * * * * * . . . * * * * * * * * * * * * *
 * * * * * * * * * * * * . . . * * * * * * * * * * *
 * * * * * * * * * * * * * * . . . * * * * * * * * *
 * * * * * * * * * * * * * * * * . . . * * * * * * *
 * * * * * * * * * * * * * * * * * * . . . * * * * *
 * * * * * * * * * * * * * * * * * * * * . . . * * *
 * * * * * * * * * * * * * * * * * * * * * * . . . *
 * * * * * * * * * * * * * * * * * * * * * * * * . .
 * * * * * * * * * * * * * * * * * * * * * * * * * *
 * * * * * * * * * * * * * * * * * * * * * * * * * *
 * * * * * * * * * * * * * * * * * * * * * * * * * *
 * * * * * * * * * * * * * * * * * * * * * * * * * *
 * * * * * * * * * * * * * * * * * * * * * * * * *B


this alternates between 1/1 and 1/2


Code: [Select]
A . * * * * * * * * * * * * * * * * * * * * * * * *
 * . . . * * * * * * * * * * * * * * * * * * * * * *
 * * * . . * * * * * * * * * * * * * * * * * * * * *
 * * * * . . . * * * * * * * * * * * * * * * * * * *
 * * * * * * . . * * * * * * * * * * * * * * * * * *
 * * * * * * * . . . * * * * * * * * * * * * * * * *
 * * * * * * * * * . . * * * * * * * * * * * * * * *
 * * * * * * * * * * . . . * * * * * * * * * * * * *
 * * * * * * * * * * * * . . * * * * * * * * * * * *
 * * * * * * * * * * * * * . . . * * * * * * * * * *
 * * * * * * * * * * * * * * * . . * * * * * * * * *
 * * * * * * * * * * * * * * * * . . . * * * * * * *
 * * * * * * * * * * * * * * * * * * . . * * * * * *
 * * * * * * * * * * * * * * * * * * * . . . * * * *
 * * * * * * * * * * * * * * * * * * * * * . . * * *
 * * * * * * * * * * * * * * * * * * * * * * . . . *
 * * * * * * * * * * * * * * * * * * * * * * * * . .
 * * * * * * * * * * * * * * * * * * * * * * * * *B

as you can see the hybrid "kinda" works but I need to figure out what the ratio is based on the 2 points entered and then carve out that path

To clairify, Im trying to create my first Dungeon Generator. and the system Im using creates a Room and then connects the rooms with halls. that connect to the center od the room. I was going to try BSP

http://doryen.eptalys.net/articles/bsp-dungeon-generation/

But im having a hard time coding the actual generator. I understand the concept but actually doing it is harder then I thought...

3
Programming / Diagonal Hallways.
« on: July 08, 2011, 02:06:15 AM »
its been a while but im back in town.

Diagonal hallways seem to be halting all progress on a Psudeo Rougelike Im working on. im trying to make a Map generator from scratch and Ive run into this problem.

I cant seem to find a formula to reduce slope to the least common Denominator.


I have 2 points the Slope before finding the LCD is 17/26 if point 1 is 0,0 and point 2 is 17,26 using

(0-17)/(0-26) = 1.5294117647059

My issue is then how do I convert theat into int rise; int run; ?? I cant just make it Round up or down cause a 1/1 and a 2/1 dont connect the points.

4
Programming / Re: Map Generator
« on: January 13, 2011, 04:27:16 AM »
WOAH!!!  :o

That not only looks Good, but its also Efficient!! This looks mad easy! Thanks!!!

5
Programming / Map Generator
« on: January 13, 2011, 03:51:22 AM »
A while ago, I made a Noise World map generator, and it was great. but now I'm interested in making the Dungeons for my game. but It stumps me to no end. I keep trying, but its not connected and Broken levels is all I get.

So I came to the place where Dungeon generating is a must! and Im asking anyone with some Experience in Dungeon Generating, if they can help. Full credit and everything in my game(currently getting assistance with path finding over at TIGForums)

Im working in java, and My Dungeons layout is going to be a 2d byte array which supports up to 255 different tile types.

If someone Could help me out Id really appreciate it!

6
Yeah but its also going to be a Seperate Re-Release, Possibly a Remake.

Funny Story I have the original game but the Label is missing... so until I played it on the 360 S.U.G.C. I didn't know it was called Fatal Labyrinth...

7
The only real issue im seeing is that everything is Being Pushed downward, Look at it on the source end, re you using a Position or button Class from a Windows Library? That might be the issue... the Easiest fix(but most time consuming) would be to Write your own versions in order to reduce Dependency on Default windows librarys. Im guessing entirely but Its the only thing I can think of. also Is there a Key I can use to Close the Book? If I could manage that I could play

8
 :'( *Sadface* It "works" in wine only partially... Everything is slightly below where it says the buttons are and I cant seem to set up an account and/or login because I cant hit enter to submit things.

EDIT: I finally got the locations right and Created an account and logged in, but I CANT CLOSE THE READING BOOK!!! theres no like... X or comand I can find to close the book... so I cant see things...

EDIT 2: Apparently its a screen rezolution thing... I cant see the Close Book Button... cause its in a part of the Screen I cant see hahaha

10
Traditional Roguelikes (Turn Based) / Re: Roguelike Game Kit
« on: August 26, 2010, 03:13:25 AM »
Interesting, Never Heard of Vector before ill have to look it up, anything Like an ArrayList of int[]? kinda?

11
Programming / Re: Questions on Writing Roguelikes
« on: August 24, 2010, 10:51:57 AM »
So for the Generator is coming Nicely

Code: [Select]
1 Itteration:
 5  4  5
 4  7  4
 5  4  5

2 Iterations:
 5  4  4  4  5
 4  5  4  5  4
 4  4  7  4  4
 4  5  4  5  4
 5  4  4  4  5

3 Iterations:
 5  7  4  6  4  6  4  6  5
 6  6  6  6  6  6  7  6  7
 4  7  5  7  4  7  5  7  4
 7  6  7  7  7  7  7  6  7
 4  7  4  7  7  7  4  7  4
 7  6  7  7  7  7  7  6  7
 4  4  5  4  4  4  5  4  4
 4  6  4  6  4  6  4  6  4
 5  4  4  4  4  4  4  4  5

4 Iterations:
 5  4  7  4  4  4  6  4  4  3  6  3  4  3  6  3  5
 3  8  4  7  4  7  4  7  4  7  4  7  4  7  4  8  4
 6  4  6  4  6  4  6  4  6  4  6  4  7  4  6  4  7
 4  7  4  8  4  8  4  7  4  7  4  8  4  8  4  8  4
 4  4  7  4  5  4  7  4  4  4  7  4  5  4  7  4  4
 4  8  4  8  4  8  4  8  4  8  4  8  4  8  4  8  4
 7  4  6  4  7  7  7  7  7  7  7  7  7  7  6  7  7
 7  8  7  8  7  8  7  9  7  9  7  8  7  8  7  8  7
 4  7  7  7  4  7  7  7  7  7  7  7  4  7  7  7  4
 7  8  7  8  7  8  7  9  7  9  7  4  7  4  7  4  7
 7  7  6  7  7  7  7  7  7  7  7  7  7  7  6  7  7
 7  3  7  3  7  3  7  3  7  3  7  3  7  3  7  3  7
 4  7  4  7  5  7  4  7  4  7  4  7  5  7  4  7  4
 7  2  7  2  7  2  7  2  7  2  7  2  7  2  7  2  7
 4  7  6  6  4  6  6  6  4  6  6  6  4  6  6  6  4
 6  2  6  2  6  2  6  2  6  2  6  2  6  2  6  2  6
 5  3  4  3  4  3  4  3  4  3  4  3  4  3  4  3  5

My source may have a logic error somewhere because the first 2 iterations are almost ALWAYS symmetrical Im Rechecking  everything now...



T=Trees ~=water .=grass
Code: [Select]
......T....T~~~..T~~~~TT~~TT.......~.....T.....T.
..........~~~~~~..~~...~TT.T....TT...............
........~~.T~~T~~..T.~.~........TT.~.............
..T...~~~~..~.~~.~~.T.~..T...T...............T.T~
.....~..~...~~~~~~~......T.T.T.....T..........T.T
.~~.T..~.~...~~~~~~~~~...........T.......T.......
...~...T.~.T.~~~~.~T~..............T.T...........
..~~~....~..~.~.~~~................T..TT........T
..~...~~..~.~~~~.T..T.......T....T...............
T~~.TT~......T.~~............~...T...............
.~TT....T...T...TT......T...~~~..................
...........~.~.~~............T.....T....T........
.~.........TTT~~~....T.....T.~...T...........T...
~~~...........~.~.T.....T........T.T.............
~TT...........~..T........T.~.T...T..............
...............T......~.......~...~..T......T..T.
...........T...~...T.~~..TT..~~...T..............

Im trying to work on a smoothing Algorythim to make the results more consistent.
Code: [Select]
after 1 smoothing pass
......T....~~~~~..~~~TT...T......TT......T..TT...
.......T...~~~~~~~~.....T......TTTT........TT.TT.
.......~~~.~~~~~~~~....TT....TTTT..........T..TT.
....T...~...~~~~~~~....TT.........T........T...T~
TT.TTT..~...~~~~~~~~~...........TTT.............T
....T...~...~~~~~~~~~.T...........T..............
....TTT.....~~~~~~~~.T..........TTT..............
....TTT.....~~~~~~..T...........................T
.~..T...TT..~~~~~...T.........T..................
....TT..TT........T....TTT.T.....................
~.........T.............TTT......................
...T......TT...~...........T.....................
~~.T......................TT.TT..TT..............
~.T..............T...TTT.TTT.TTTTT...............
.T..........T....T.T.TTT..T.....TTT..............
...........TTT..TTTT..T...T....TTT...............
...........T...~...T.~~..TT..~~...T..............



after 2 Smoothing Passes
........T..~~~~~~~~~.....T.....TTT........TTTTT..
......T...~~~~~~~~~~....T......TTT.........TT.TT.
.....T.....~~~~~~~~~....T.....TTTT.........TTTTT.
..TTT......~~~~~~~~~~..T........TT.............T~
T..TTT.....~~~~~~~~~~..T.........T..............T
...........~~~~~~~~~..T.........TT...............
.....T.....~~~~~~~~..T..........TT...............
............~~~~~~...T..........................T
.....TTT.....~~~~...T...TT.TTTTT.................
....TTTTTT........T.....TTTT..TT.................
....T.....T.......T......TTT..TT.................
~..T.......T......T......TT...TT.................
~...........T.....T....TTTT..TTTTT...............
..T.........T....TTTTTTTTTT....TTT...............
T...........T....TTTTTTT.TT.....TT...............
...........TT....TT......TT....TT................
...........T...~...T.~~..TT..~~...T..............


After 3 Smoothing Passes
......T...~~~~~~~~~~....TT.....TTT.........TTTT..
.....TT...~~~~~~~~~~....TT....TTTT.........TTTTT.
....TT....~~~~~~~~~~~...T.....TTTT.........TTTTT.
TTTTT.....~~~~~~~~~~~..TT......TTT............TT~
..........~~~~~~~~~~~..T.......TTT.............TT
..........~~~~~~~~~~..TT.......TTT...............
...........~~~~~~~~...TTT.....TTTT...............
...........~~~~~~~...TTTTTTTTTTTT...............T
............~~~~~...TTTTTTTTTTTT.................
.....TTTT.....~~...T....TTTT..TT.................
....T....TT.......TT....TTT...TTT................
~..T......TT......TT...TTTT...TTT................
...........T......TTTTTTTTT....TTT...............
.TT........TT.....TTTTTTTTT.....TT...............
...........TT.........TTTTT.....TT...............
...........TT..........T.TT....T.................
...........T...~...T.~~..TT..~~...T..............

12
Traditional Roguelikes (Turn Based) / Re: Roguelike Game Kit
« on: August 24, 2010, 06:25:57 AM »
Im interested in knowing, how do you store the map data? is it an Int array and the values are the diferent pieces? or is it more complicated then that?

EDIT: Sorry For posting in the wrong one! Got confused!

13
Hang in there fighting the good fight JayPC, bound to get things knocked out at some point and there are many helpful folk around here to boot.   8)

So ive noticed! haha Cant wait to get somthing done! its good to feel welcomed unlike some other places ive gone haha

14
Well Had I seen this I would have Posted my intro here!!!

anyway Names John im 2, JPC is my initials so its how I got My user name in case anyone asks which I dont get often but Im geting it out of the way now.

Im a Great Designer... because I do the Big picture thing really well and I am good at keeping a tem on track.... the problem is my, Jack of all trades, master of none, knowledge base... my Skills in anything are limited at best, thus I do alot of:

Quote
1)Great Idea
2)Research in building great Idea
3)attempt building great Idea but get stuck
4)Draw Concept art to fill void of great Idea
5)Determine that my art isent what I really wanted to go for and start over
6)Determine tis new art is no good but would totaly work for my next... See step 1

This cycle is common for the most part but there are the couple Ideas I keep coming back too which I try to work on when I can... one of them I have been working on since I was 12and its come a long way since then... I mean come on My character name was Shadow Phantom... Unoriginal much? but the name stuck up until my senior year in highschool.

I hope to actually FINISH my first game here... of course I thought it was going to be alot easyer then its been... and it, as usual, WAY more complicated then I had originaly planned...

needless to say Hi everyone, If I can help Ill try but Ill probably be asking for help more then Giving it Sorry!

15
Programming / Re: Template problem
« on: August 22, 2010, 03:31:00 AM »
Dont even know what language this is but Have you tested to make sure its entering the for loop at all? also if list<U_door*> is a Cast and list<T> is a cast you have made me verry confused. as why your passing load_object_list() a U_door* List when it needs a T list...

Otherwise I cant help since Im guessing how any of this works haha!

Pages: [1] 2