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 - TheIronPainter

Pages: [1]
1
Traditional Roguelikes (Turn-based) / God of Change
« on: May 11, 2012, 02:21:30 AM »
Just played through this game and thought it was creative as hell.

What really turned me on was the lighting system as well as the random cavern generator. I am trying to create a themed dungeon level generator algorithm with little success. Rather, I'm successful, but it doesn't end up looking like a real cavern. Not at least like the caverns you find in God of Change.

I would like to discuss with others their take on God of Change and/or their own versions of themed dungeon algorithms.

Not sure if this falls under development or not, but I wanted to give God of Change it's due accolades.

2
Programming / Re: Djkstra's Pathfinding in QBASIC 4.5
« on: May 09, 2012, 08:55:27 PM »
Nostalgia... it gets the best of us  ;)

3
Programming / Re: Ye Olde Roguelike Grimoire
« on: May 09, 2012, 08:54:25 PM »
I would look into the old adventure game LOOM. In that game, you used the keyboard to play and weave songs to create magic spells. If nothing else, it's an epic game with some really amazing scenes.

4
Programming / Re: Djkstra's Pathfinding in QBASIC 4.5
« on: May 08, 2012, 10:03:50 PM »
Jocke,

Got it to work. Thanks a ton. I'm having some cross-over problems though.

Here is a small sample of code. Hopefully.

I am having scope issues that I never had in QuickBasic 4.5...  for some reason the array Map$ is not getting translated to either of the sub-routines... I have no idea what's the problem other than a potential FreeBASIC related issue. Thanks,


Quote
'$lang: "fblite"

''----------------Program Initialization-------------------------
CLS
SCREEN 18, 32
WIDTH 80, 60
RANDOMIZE TIMER

''-----------------Cavern Subroutines----------------------------

DECLARE SUB CavernInit
DECLARE SUB FirstCavernRoomInit
DECLARE SUB BuildCavern(RoomCenterX as Integer, RoomCenterY as Integer, RoomWidth as Integer, RoomHeight as Integer)

''-----------------Map-Related Subroutines-----------------------

DECLARE SUB PrintTile(X as Integer, Y as Integer)

''-------------Map-Related Variable Declarations-----------------

DIM SHARED Map$()   'The main dungeon map
DIM SHARED Item$()  'The main "item" map
DIM SHARED Monster$() 'The main "monster" map


DIM Shared MaxScreenWidth = 50
DIM Shared MaxScreenHeight = 50
ReDIM Map$(1 to MaxScreenWidth, 1 to MaxScreenHeight)
ReDIM Item$(1 to MaxScreenWidth, 1 to MaxScreenHeight)

''---------------------------------------------------------------

''XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
''X                     MAIN PROGRAM MODULE                     X
''XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


''----------------Fill the whole map in with rock----------------

CavernInit
sleep

FirstCavernRoomInit
sleep



'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
'/ Fill the entire map in with solid rock     \
'----------------------------------------------
'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

SUB CavernInit
   
FOR X = 1 TO MaxScreenWIDTH
   FOR Y = 1 TO MaxScreenHEIGHT
      Map$(X, Y) = "0"     
   NEXT Y
NEXT X

FOR X = 1 TO MaxScreenWIDTH
   FOR Y = 1 TO MaxScreenHEIGHT
      Item$(X, Y) = "0"
   NEXT Y
NEXT X

END SUB


SUB FirstCavernRoomInit

'-----------------Randomly determine the room size------------------

RoomWIDTH = INT(RND * 3) + 1
RoomHEIGHT = INT(RND * 3) + 1


RoomCenterX = MaxScreenWIDTH / 2     
RoomCenterY = MaxScreenHEIGHT / 2   

Map$(RoomCenterX, RoomCenterY) = "1"

'-----------------Dig out the first room from the rock--------------

BuildCavern (RoomCenterX, RoomCenterY, RoomWIDTH, RoomHEIGHT)

END SUB


SUB BuildCavern (RoomCenterX, RoomCenterY, RoomWIDTH, RoomHEIGHT)

'-----------------FIRST FILL IN THE FLOORING------------------------------

FOR X = (RoomCenterX - RoomWIDTH) TO (RoomCenterX + RoomWIDTH)
   FOR Y = (RoomCenterY + -RoomHEIGHT) TO (RoomCenterY + RoomHEIGHT)
      Map$(X, Y) = "·"     
      PrintTile X, Y
   NEXT Y
NEXT X

'-----------------NOW FILL IN THE WALLS-----------------------------------

'-----------------MAKE THE RIGHT WALL-------------------------------------
X = RoomCenterX + RoomWIDTH + 1
FOR Y = (RoomCenterY - RoomHEIGHT - 1) TO (RoomCenterY + RoomHEIGHT + 1)
   Map$(X, Y) = "#"
   PrintTile X, Y
NEXT Y

'-----------------MAKE THE LEFT WALL--------------------------------------
X = RoomCenterX - RoomWIDTH - 1
FOR Y = (RoomCenterY - RoomHEIGHT - 1) TO (RoomCenterY + RoomHEIGHT + 1)
   Map$(X, Y) = "#"
   PrintTile X, Y
NEXT Y

'-----------------MAKE THE BOTTOM WALL------------------------------------
Y = RoomCenterY + RoomHEIGHT + 1
FOR X = (RoomCenterX - RoomWIDTH - 1) TO (RoomCenterX + RoomWIDTH + 1)
   Map$(X, Y) = "#"
   PrintTile X, Y
NEXT X

'-----------------MAKE THE TOP WALL---------------------------------------
Y = RoomCenterY - RoomHEIGHT - 1
FOR X = (RoomCenterX - RoomWIDTH - 1) TO (RoomCenterX + RoomWIDTH + 1)
   Map$(X, Y) = "#"
   PrintTile X, Y
NEXT X

END SUB


SUB PrintTile (X, Y)

IF Item$(X, Y) <> "0" THEN GOTO PrintItem  'If there is an item here print that
                                           'first.
SELECT CASE Map$(X, Y)

        CASE "#"                  'A stone wall
          COLOR 8
          LOCATE Y, X: PRINT "#"
       
        CASE "·"                  'A stone floor
          COLOR 15
          LOCATE Y, X: PRINT "·"
       
        CASE "+"                  'A stone door
          COLOR 7
          LOCATE Y, X: PRINT "+"
       
        CASE ">"                  'Stairs Down
          COLOR 7
          LOCATE Y, X: PRINT ">"

        CASE "<"                  'Stairs Up
          COLOR 7
          LOCATE Y, X: PRINT "<"

        CASE "þ"                  'Wooden Crate
          COLOR 6
          LOCATE Y, X: PRINT "þ"
       
        CASE "_"                  'Spawn Portal
          COLOR 13
          LOCATE Y, X: PRINT "_"

        CASE "$"                  'Gold Coins
          COLOR 14
          LOCATE Y, X: PRINT "$"

        CASE "-"
          COLOR 7
          LOCATE Y, X: PRINT "-"  'Open Up/Down Stone Door

        CASE "/"
          COLOR 7
          LOCATE Y, X: PRINT "/"  'Open Right/Left Stone Door
     
        CASE "3"
          COLOR 8, 2
          LOCATE Y, X: PRINT "²"  'Mossy Wall

        CASE "'"
          COLOR 2
          LOCATE Y, X: PRINT "ú"   'Mossy floor

        CASE ELSE

END SELECT
COLOR 0, 0

PrintItem:
SELECT CASE Item$(X, Y)

        CASE "c"                  'A wooden crate
          COLOR 6
          LOCATE Y, X: PRINT "þ"
     
        CASE "$"                  'Gold Coins
          COLOR 14
          LOCATE Y, X: PRINT "$"

END SELECT
COLOR 0, 0
END SUB




5
Programming / Re: Djkstra's Pathfinding in QBASIC 4.5
« on: May 07, 2012, 07:32:27 PM »
You have made somebody really happy and for that I thank you Jocke. Already chugging away now under the new editor, FBIde. Happy they even have a "borland" graphics theme.

For YEARS I always had the desire to build a respectable QBASIC game even without objects, etc... call it a touch of nostalgia, call it what you will. I mean, let's face it, GW-BASIC has a place in history, however small.

If I have any further questions (which I will) should I append them to this subject or start a new thread. As I am new to the forum I don't want to be that guy, we all know who 'that guy' is, who doesn't play by the rules and invariably becomes a pest.

Thanks again, really.

One question. Whenever I load an old .bas file I get a blank screen with "ü" on line 1 and nothing else...

6
Programming / Re: Djkstra's Pathfinding in QBASIC 4.5
« on: May 04, 2012, 11:20:21 PM »
Wow... I was not expecting the kind replies like this. A great thanks is in order. Thanks!

You all have solved my problem, in one way or another. And I greatly appreciate the clarification of the pseudo-code as well as a good delete alternative for non-pointered stacks. Already converted and implemented!

What I have feared is happening, however. I have a 40kb program before combat and sound... perhaps it is just time to tuck tail and convert it all to C++. The last thing I want to do is keep putting more time into this project and then get held back at the last second by a measly few kbs of code.

To answer a few other questions. I don't have the binary, and I'm running in the emulated console DosBox. I like DosBox because you can crank up the frame-rate making an already slow Qbasic program run almost as if it were programmed by a better programmer  ;)

In the next few coming months I look forward to sharing with you all my version of a roguelike I have been wanting to program for AGES... thankfully none of you have thought about the idea yet so I'm eager to implement and be the first! It was a good fight but I think I've reached my limit with QBasic 4.5....

*sigh*

7
Programming / Djkstra's Pathfinding in QBASIC 4.5
« on: May 02, 2012, 07:15:45 PM »
Hello, I'm new to the forum so be gentle.

I have chosen QuickBasic 4.5 as my programming language. Now before you all moan and groan hear me out.

I started programming at 12 and QBasic was what I learned on. For years and years I made tid-bits of games for Qbasic but never followed through. I now want to prove to myself and the world that you CAN make a decent Roguelike in this language even if it cannot come close to the complexity of a C# or C++ game.

Anyway... my real question is that I am converting the Djkstra's pathfinding pseudo-code into Qbasic but I ran into a problem. The step is here:

3.) If the successor doesn't exist on either the OPEN list or the CLOSED list, add it to the OPEN list.

We're fine.... but further...

Otherwise, if the successor's movement cost is lower than the movement cost of the same tile on one of the lists, delete the occurrences of the successor from the lists and add the successor to the OPEN list.

Problem!

I A.) Don't know what that means exactly, and B.) Have a problem deleting from my lists because instead of pointer stacks they are arrays (since qbasic doesn't use pointers)

I have samples of code for anybody that are commented out the ying yang if anybody cares to help me out.

Thanks in advance :)

Pages: [1]