LAND - A Multi-User Dungeon (well almost)

new games to be launched and discussed here
fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sun Aug 11, 2019 8:20 pm

Me too !

User avatar
AndyF
Posts: 1276
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by AndyF » Mon Aug 12, 2019 8:51 pm

=D> I concur.

When I tried to (about 5 years back now! *ahem* I really should try to find time to write some as I do enjoy it) do a variant of Cave , I noted some odd Quill bugs, I never documented them as they were not too common. Not going to be a problem for you anyway! :)
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Wed Aug 14, 2019 6:32 pm

I've now completed two of the three SW Ram locations which equates to 229 locations (32k)
As per the mainframe original I'm adding deaths as locations, it's a lot easier this way especially when you're in a maze and there are lots of wrong exits from which to die the same death.
landsplat.jpg
After my hols I'll complete the third SW RAM location file, I'm looking forward to my walkaround..

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sun Aug 25, 2019 3:07 pm

While on holiday I've been reading a bit about beebasm and think it would be perfect for developing my game. Due to memory limitations I've had to break the program up into numerous smaller files which are then stitched together to create the executable file. Am I right in thinking that using beebasm, if I start at say P%=&1100 I won't have to worry about memory limitations in the same way because the code itself is not contained in a Basic program? I can then have my look up tables just below screen memory and the program can have the rest of memory up to them ?
Last edited by fuzzel on Sun Aug 25, 2019 3:07 pm, edited 1 time in total.

User avatar
tricky
Posts: 3774
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by tricky » Sun Aug 25, 2019 4:06 pm

That's correct, it will even build a disc image for you.
There are some syntax highliting files for VSCode and notepad++ I think. I use visual studio - no syntax highliting, but I do have it set up to launch an emulator which boots the disc (the other options also have ways to launch an emulator).

There is a beebasm section on retrosoftware, but there is probably a more up to date one on github.

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sun Aug 25, 2019 4:18 pm

Thanks, will download it when I get home. It should be a huge help.

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Fri Sep 13, 2019 2:27 pm

And I was making such good progress! I've now entered 280 locations and my intention was to utilise 3 SW Ram banks to accommodate the locations and then the fourth would store the messages. With 2/3 of the locations squeezed into 2 SW Ram banks I was well on course but unfortunately in the final third I appear to have been overcome by a bout of verbal diarrhoea when writing up the Wizards' Tower locations so I've had to use all 4 banks for the locations. The good news is that in the Beebem rom configuration screen you can designate rom sockets as SW Ram by clicking the button on the right (I've tested it and it works). So I'm now considering future projects of Mist (400+ locations) and the original Essex MUD (500+ locations). I'd also really like to do a Zork conversion).


User avatar
Elminster
Posts: 3950
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by Elminster » Sat Sep 14, 2019 8:01 am

tricky wrote:
Sun Aug 25, 2019 4:06 pm
There are some syntax highliting files for VSCode and notepad++ I think. I use visual studio - no syntax highliting,
And BBEdit on the Mac, although I have been using Atom (the open source editor, not the computer) a fair bit recently. Might look at syntax highlighting for bbc basic/6502 as that is cross platform. Might even be there already off course, not checked.

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Wed Sep 18, 2019 9:07 am

At last! I've now entered all locations and after a bit of a wobble for a couple of days where I couldn't get the fourth location SWR bank to work (it kept referencing the third one instead even though my code definitely pointed to the fourth - so I reloaded my backup, rewrote my code and it worked strangely) so now I'm having a massive walkabout to ensure that all SWR banks and locations are knitted together correctly. Next I'm going to experiment with my "spare" location byte to add some bit flags (up to eight) for each location eg light / dark rooms and whether you've visited the room yet (if you have you will only see the brief location title next time you visit the room).
Last edited by fuzzel on Wed Sep 18, 2019 9:07 am, edited 2 times in total.

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Tue Sep 24, 2019 6:16 pm

I'm trying to get beebasm to work in windows without any success. I've downloaded version 1.09 (exe) but it fails to run directly in Windows 10.
Anyone know what I'm doing wrong ? There's mention on the github web page about it running under mingw and cygwin but I haven't the foggiest idea what they're for. Can someone point me in the direction of a simple installation procedure for beebasm for Windows 10 ?

User avatar
0xC0DE
Posts: 356
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by 0xC0DE » Tue Sep 24, 2019 7:05 pm

I'm using beebasm on windows 10. It's a command line tool, no installation. What's the exact issue or error you're experiencing?
0xC0DE
:idea: Follow me on Twitter :idea: Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Tue Sep 24, 2019 8:54 pm

No error really, I just run it from my downloads folder and nothing happens. I said yes to allow it to make changes to the pc.
It looks as though a box very briefly appears on screen then disappears.
Last edited by fuzzel on Tue Sep 24, 2019 8:56 pm, edited 1 time in total.

User avatar
0xC0DE
Posts: 356
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by 0xC0DE » Tue Sep 24, 2019 9:32 pm

That's because it's a command line tool. It will not open a GUI (window).
See also: https://github.com/stardot/beebasm/blob ... /README.md

Try opening a command prompt (cmd) and then type beebasm.exe --help
0xC0DE
:idea: Follow me on Twitter :idea: Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Wed Sep 25, 2019 6:41 am

Thanks, I've got it working in a command prompt window. I now need a file to work on, where do I get a blank .asm file from ?
I assumed that the command:
beebasm -i simple.asm -do test.ssd -boot MyCode -v
would create a blank file called simple.asm but instead it's trying to load it.

UPDATE - I've just answered my own question. I copied and pasted the example program into a blank notepad file, saved it as simple.asm in the
beebasm folder and it created the test.ssd disc when I entered the command line above. Simple! Now to get to work..
Last edited by fuzzel on Wed Sep 25, 2019 6:58 am, edited 1 time in total.

User avatar
0xC0DE
Posts: 356
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by 0xC0DE » Wed Sep 25, 2019 7:02 am

The .asm file is a text file as input to beebasm. Create it with your favorite text editor. It doesn't have to have .asm extension though. I usually name my source files .6502
As long as it is a plain text file.

Very handy is VSCode with 6502 syntax coloring. Same goes for Notepad++
0xC0DE
:idea: Follow me on Twitter :idea: Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

User avatar
Elminster
Posts: 3950
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by Elminster » Wed Sep 25, 2019 8:42 am

0xC0DE wrote:
Wed Sep 25, 2019 7:02 am
The .asm file is a text file as input to beebasm. Create it with your favorite text editor. It doesn't have to have .asm extension though. I usually name my source files .6502
As long as it is a plain text file.

Very handy is VSCode with 6502 syntax coloring. Same goes for Notepad++
ATOM (the open source cross-platform editor) has BBC Basic highlighting but I think someone needs add 6502 as I couldn't see that.

Edit: ah it does have 6502 as well
Last edited by Elminster on Sat Sep 28, 2019 3:59 pm, edited 1 time in total.

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Wed Sep 25, 2019 5:28 pm

A busy day indeed! I've now dispensed with basic in Beebem for writing assembly language programs as I've managed to move my main program into beebasm. It took a couple of hours to get it working, running the beebasm version and then loading both programs into memory and comparing byte by byte until they were identical. In fact due to memory constraints previously I'd had to split my main program up into 4 separate chunks so now I can stitch them back together again in beebasm. When one of the programs called a subroutine in another program, if I then changed the other file I'd have to modify the memory address call of the original program which was a right hassle.

btw, many, many thanks to Rich Talbot-Watkins for this, you're a star !!

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Fri Sep 27, 2019 5:13 pm

I'm trying to generate random numbers to use in conjunction with an interrupt routine so I can have a mobile wandering around independent of the player's move counter. In a regular text adventure the you normally take it in turns with the program i.e. your action results in an action or number of actions by the program. However, what I'd like is for actors within the program to act independently of the player (eg you make yourself a cup of tea and on your return find you've been bludgeoned by a berserker with a very nasty broadsword).
I've experimented with LDA&FE64 and LDA&240 as recommended in a previous post where, for example, a character is printed on screen if the value of A<8. However, I've noticed that I seem to get a run of characters then a pause then another run of characters. Is this because &FE64 and &240 are not being updated before the interrupt is performed again ? (I'm using for this purpose *FX14,4 - start of vertical sync, as it seems the most appropriate). If I'm right how do I force a random change in the contents of &FE64 and/or &240 ?
Last edited by fuzzel on Fri Sep 27, 2019 5:14 pm, edited 1 time in total.

User avatar
0xC0DE
Posts: 356
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by 0xC0DE » Fri Sep 27, 2019 6:05 pm

It's best if you use a PRNG (pseudo random number generator), for instance from one of my demo effects:

Code: Select all

.rand16 {
  asl zrnd
  rol zrnd+1
  bcc r1
  lda zrnd
  eor #$E7
  sta zrnd
  tax
  lda zrnd+1
  eor #$8D
  sta zrnd+1
  rts
.r1
  ldx zrnd
  lda zrnd+1
  rts
}

.rand8 {
  jsr rand16 ; 1 bit of entropy per call
  jsr rand16 
  jsr rand16 
  jsr rand16 
  jsr rand16 
  jsr rand16 
  jsr rand16 
  jmp rand16 
}
zrnd is a 16-bit variable in zero page. You seed this (initial value) from &240 for instance.
0xC0DE
:idea: Follow me on Twitter :idea: Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Fri Sep 27, 2019 6:15 pm

Many thanks for that 0xcode, hopefully I can post an example of the mobile in action over the weekend. It's my mini project before I start populating the game with objects. Btw further to previous posts my entire code for the game is now a single beebasm file which is fantastic !
I wonder what other development software is out there? Probably the most time intensive thing I have to do is the locations. I have a basic program with the 650 "words" for the compressor in but my basic program can only use it to compress up to 20 locations of text at a time due to memory constraints. If there was a similar program to beebasm which worked outside an emulator and which could generate a 16k data file from a large basic file that would be tremendous. I would then need to get it into an emulator of course which is why beebasm is so good.

User avatar
0xC0DE
Posts: 356
Joined: Tue Mar 19, 2019 7:52 pm
Location: The Netherlands
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by 0xC0DE » Fri Sep 27, 2019 6:21 pm

You may want to look into the directives incbin and include in BeebAsm to create your final binary from separate data files (incbin) and separate assembler files (include). Makes it easier to manage smaller data or text files that get literally assembled into one final binary.
0xC0DE
:idea: Follow me on Twitter :idea: Visit my YouTube channel featuring my demos for Acorn Electron and BBC Micro

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sat Sep 28, 2019 11:11 am

I'm still struggling with the random number generation. I'm trying to get my mobile to wander around my game and perform various actions. I'm calling it "Project silver elf". Initially the rule is that after approximately every 10 seconds he/she has to decide whether to stay put or move. Using the elf's location I've pointed to the lookup table for the 12 directions from my locations data file and I need to generate a random number between 1 and 12 which is >0 otherwise try again until it does (1=N, 2=S etc). However, using this simple technique to store a random number in &90:
.rnd
LDA&FE64
CMP#12
BCS rnd
STA&90
RTS

I never (or probably very rarely) get a random number less than 7 so it doesn't appear to be that random. Anyone got any idea what's happening here and recommend any changes? Ideally I'd like a short routine that produces a random number between 0 and X.

User avatar
hoglet
Posts: 8582
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by hoglet » Sat Sep 28, 2019 11:29 am

Try this varient:
random.png
It's still slightly biased I think.

A better way to do it would be to read the 8 bit value, then calculate MODULO 12.

Dave
Last edited by hoglet on Sat Sep 28, 2019 11:32 am, edited 1 time in total.

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sat Sep 28, 2019 11:54 am

Thanks hoglet, that worked, this shows the location numbers visited by the elf:
elfs gone walkabouts.jpg
This is probably the most boring screenshot ever but the Elf is following my map precisely.
Now to incorporate it within the game using the interrupt routine...

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sun Oct 20, 2019 6:05 pm

This morning I decided, enough is enough, I'm not doing any more development work on Land until I've got a working scoring system in place. The criteria was I needed to be able to store and print a score between 0 and 99,999 and increment the score by up to 250 at a time (this would be for banking the very best treasure or killing the giant dragon). I'd investigated decimal mode in assembly language but I just couldn't get my head around it, simple programs I'd written producing bizarre results, so I binned that idea. The problem was that a score (or so I thought) would have to be stored as two bytes, the low byte being 0-255 and the high byte being multiples of 255. However, this proved extremely difficult to convert to a decimal number which could be printed on screen. Another thought was to find the compiler rom I used to own bitd, write a simple basic program, convert to assembly language and use that. However, after much rumination this morning and a soaking out walking in the rain I hit upon a solution, store digits 0-9 in one byte, the tens in the 2nd byte, the hundreds in the 3rd byte and so on. Then increase the current score by 1 until it reached the points increase, each time checking if each byte had reached 10 in which case reset that byte to 0 and add 1 to the next byte up. When printing, from the ten thousands byte downwards, it had to ignore zeros until it came to the first number in the range 1 to 9. This worked a treat. So I now have a system for scoring and also storing other variables such as health (in this case I'll need to write a subtract routine as your health can go up or down). I figured in the end it wouldn't be that hard, after all, hundreds of programmers have had to deal with this problem writing their arcade games or adventures.

SteveF
Posts: 516
Joined: Fri Aug 28, 2015 8:34 pm
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by SteveF » Sat Oct 26, 2019 11:48 pm

Great to see work continuing on this, I'm enjoying this dev blog sort of thread!

I'm glad you figured out a solution on your own, it's a great way to learn and getting something that works is the main thing. But FWIW, a more conventional approach would be to store the score as a 16-bit number in two bytes as you mentioned. There's some code on BeebWiki which can take a number stored like that and print it out in decimal: http://www.beebwiki.mdfs.net/Number_out ... it_decimal I could totally understand it if you wanted to write every line of code yourself, though!

fuzzel
Posts: 444
Joined: Sun Jan 02, 2005 1:16 pm
Location: Cullercoats, North Tyneside
Contact:

Re: LAND - A Multi-User Dungeon (well almost)

Post by fuzzel » Sun Nov 10, 2019 7:20 pm

I've been busy correcting typos in my location text which is rather time-consuming. As there are approximately 350 location and I'm having to compress the text I have 3 text files of 16k each which are stored in 3 SW Ram banks (plus a smaller fourth one for the balance). To compress the data I'm using Basic programs and because each has all 620 compression words in I can only compress between 10 and 20 locations at a time so each SW Ram file is comprised of approximately 9 files which have to be stitched together. However, rather serendipitously, I was reading through the July 1984 issue of The Micro User this morning and came across a review of the Acorn 6502 Second Processor which mentioned that you could access up to 44k of memory in Basic. I did a search online and found a very useful webpage which had a manual for it along with lots of other Acorn guides and set to work. Basically, the second processor allows you to have PAGE set to &800 and you can use all memory up to &8000 (screen memory is stored in the second processor), but even better, if you set LOMEM to &C000 and HIMEM to &F800, this area will be used by your Basic program to store variables so you can use the area above Top to &8000 for the data you create. I've just created a much larger data file in Basic which handles 55 locations at a go rather than the paltry 15 or so I had previously, so this will reduce my workload considerably (once I've increased it considerably by creating my new files!)
For reference, the website where the manuals can be found is at:

http://chrisacorns.computinghistory.org ... nuals.html

Nice one Chris !

Post Reply