Text RPG Design Thread [1 new, on: Screenshot, working cmd]

Advanced game related topics
Jagermeister
Enthusiast
Enthusiast
Posts: 136
Joined: Thu Nov 15, 2012 11:38 pm
Location: Los Angeles

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Jagermeister »

Chicken scratch of a map generator. Perhaps attach it to the earlier code of room id generator or have this one spit out coords. Press F5 to generate new maps - hold it for map roulette :)

Code: Select all

;Free to use and abuse. Love, Jag.

Enumeration
  #F5key
EndEnumeration

Declare generate_map()

OpenWindow(0, 0, 0, 600, 600, "map gen", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
AddKeyboardShortcut(0, #PB_Shortcut_F5, #F5key)
BindEvent(#PB_Event_Menu, @generate_map(), 0, #F5key)

Procedure generate_map()
  
  X = (WindowWidth(0)/2)
  Y = (WindowHeight(0)/2)
  line_x = X
  line_y = Y
  StartDrawing(WindowOutput(0))
  Box(0,0,600,600,$000000) ; background for contrast
   StopDrawing()
  Repeat
    If StartDrawing(WindowOutput(0))
      dir = Random(4,1) ; Change to 8 for diagonal
      If dir <> last_dir
      Select dir
        Case 1 ; north
          line_y - 20
        Case 2 ; east
          line_x + 20
        Case 3 ; south
          line_y + 20
        Case 4 ; west
          line_x - 20
        Case 5 ; northeast
          line_y - 20 : line_x + 20
        Case 6 ; southeast
          line_x + 20 : line_y + 20
        Case 7 ; southwest
          line_y + 20 : line_x - 20
        Case 8 ; northwest
          line_y - 20 : line_x - 20
      EndSelect
      LineXY(x,y,line_x,line_y,$00FFFF)
      Box(X-7,Y-7,15,15,$FF0000)
      x = line_x
      y = line_y
    EndIf
     last_dir = dir
      StopDrawing()
    EndIf
    l + 1
  Until l = 140 ; number of iterations. Won't produce exact as there is no overlap check
  
EndProcedure

generate_map()

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
End
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Zach »

Well it's been a long time and things are worse than I thought. I pretty much lost everything I had been working on, I've only been able to find basic prototype based code from 2011 or so.

My XML database is gone
rudimentary command parsing is gone
screen printing routines are gone.
The GUI I had built and Macro/hotkey stuff is gone

all I got is the snippets posted here I guess I'm starting over from scratch..... :oops:

I guess I will be learning everything from scratch again :cry:
Image
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by mk-soft »

This is more than annoying. :(

Some things you could find here in the forum.
But Purebasic has also evolved and much of what you used to program goes with a new view on things, certainly easier.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Zach »

That is true. In my case, a lot of the stuff I did was stuff that I don't think would have needed to be altered (like the RTF parsing you helped me with, that was different).

But starting over is hard mostly because, as explained in off-topic I have no programmed for a number of years, that's why losing the source code hurts more than anything.
I was very meticulous about commenting my code and explaining what was going on in every step so I could look at it years later without problems.

So all the knowledge, not just the code data, is lost from my brain :?

This is my fault for not establishing an online repository of some such.
Image
Nituvious
Addict
Addict
Posts: 999
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Nituvious »

Hi Zack,
Have you considered using a version control software? I use bitbucket myself. It's pretty great, and they even offer free private repositories.
They also have a nice client, SourceTree, which works on windows.
▓▓▓▓▓▒▒▒▒▒░░░░░
Bitblazer
Enthusiast
Enthusiast
Posts: 733
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Bitblazer »

Inform could be interesting for your project. There are some years of work and several (commercial) adventures based on it.
webpage - discord chat links -> purebasic GPT4All
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Zach »

Nituvious wrote:Hi Zack,
Have you considered using a version control software? I use bitbucket myself. It's pretty great, and they even offer free private repositories.
They also have a nice client, SourceTree, which works on windows.
I have looked into VCS before, but never really beyond the surface / considering the idea. I'm really weird, and I think I didn't want to bother with it because I don't think I can use it the way I want. I would like to manage that kind of thing from within the PB IDE. Kind of like the way Dreamweaver etc could sync projects to a web server, and even allow multiple people to check out and lock a file, etc.

But I really need to look into it. Especially if I'm going to attempt rewriting my engine from scratch. Not that I got very far, lol.
Image
Zach
Addict
Addict
Posts: 1654
Joined: Sun Dec 12, 2010 12:36 am
Location: Somewhere in the midwest
Contact:

Re: Text RPG Design Thread [1 new, on: Screenshot, working c

Post by Zach »

Bitblazer wrote:Inform could be interesting for your project. There are some years of work and several (commercial) adventures based on it.
Yes, I looked at stuff like Inform, TADS, etc. I just didn't like the way they worked I think. Also I suck at learning other peoples syntax and stuff like that. I am a control freak, I would like a finer level of control, and be able to implement and test an idea rapidly, with code I know inside and out ( hopeuflly ).

I think part of it is also the same reason I have played around with things like RPG Maker in the past, but would never attempt a serious game with it. Yes, it can be done and work quite well and professional. But it requires a lot of skill and dedication, time, etc I don't necessarily have. Also, it doesn't carry the same weight as doing it yourself and compiling an executable, I guess.. idk if that makes sense.

I've always wanted to program, and I've always wanted to make a game, so its kind of two birds with one stone. So now that I am at a point in picking up the pieces of my life where things have kind of improved, I am trying to get back into Purebasic. That's all there is to it.
Image
Post Reply