Monopoly

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

There is a 'open-source' shuffling routine I wrote. Don't know where it is (somewhere in programming help or in the old battlecards threads). It works rather well, even if I say myself. NanoWar does use it too.
Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Thanks kv! I remember looking through the programming help sections at the various shuffling threads. I've got the basic concept down, I just can't convert it to assembly. I have trouble keeping track of all the variables and such.

I'll have a stroll through to see if I can find something helpful :)
User avatar
kv83
Maxcoderz Staff
Posts: 2735
Joined: Wed 15 Dec, 2004 7:26 pm
Location: The Hague, Netherlands
Contact:

Post by kv83 »

Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Image

Image

Ok, so it took forever to get to a chance tile. Sorry about that. Also, I fixed the thing when you land on St. Charles, I think it was. I had accidentally tossed in an extra value so I deleted it. It no longer costs 38057 whatever dollars :).
Last edited by chickendude on Thu 03 Aug, 2006 5:29 pm, edited 1 time in total.
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

That looks great. :D
It's always nice to see screenies, no matter whether it is the finished version or not. This definately looks better than the old asm monopoly. :)

I'd help you with the sprites, but I'm terrible at it. :)

Hmm, I wonder whatever happened to theCheat. :puzzled: he always used to do a bunch of good pixel art.
In Memory of the Maxcoderz Trophy Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Thank you!

And MadSkillz has offered to draw the sprites (and drawn a few already!) so soon I'll have the updated character tokens.

I just devised how I'm going to handle chance cards. Each line of text is a 0 terminated string is displayed with vputs. Therefore, since vputs stops at the byte after the 0, that's where I'll store the macro-type things. We'll say there's 10 different options that can be taken: cp 10 \ jr nc, display_next_line \ blah stuff that handles the macro things.

Simple enough. I also copied/pasted the text for the community chest cards from wikipedia into the chance routine.

I'm still wondering how I should handle the get out of jail free card. I could overwrite it with null values, then check for the null value and if I get it skip to the next card to read it, however the way I shuffle the card shuffles the array they're in. Therefore, if I did that method I'd have to initialize the array everytime a new game was started.

I could also shift each piece of the array left and pop the get out of jail free card onto the end of it, then have a variable toggle whether or not to check for 15 or 16 cards...

Any suggestions? On anything? Comments?
Liazon
Calc Guru
Posts: 962
Joined: Thu 27 Oct, 2005 8:28 pm

Post by Liazon »

:) very nice! Overall gui seems very natural.
Image Image Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Alright, so I tossed in those sprites that Madskillz drew, and they look excellent :) This weekend I'm going to try to integrate the chance and community chest routines, so that I don't need two separate routines.

Oh, and I'm also encroaching 8,000 bytes :o (currently around 7750). I'm really scared of going over 8k. 7k wasn't so bad, as I essentially jumped from 6 k to 7.5k just by adding in all the text from chance/community chest and the other sprites for the characters (each character takes up 48 bytes, 24 for the sprites and 24 for the masks). But 8k really reflects how inflated my code is.

Example:

Code: Select all

checkPosition:
 ld hl,playerdata+2   ;this is their position on the board: 0=GO, 1=baltic ave, ...39=park place, etc.
 inc (hl)
 ld a,(hl)
 cp 40               ;if a is maxed out at 40
 jr nz,skipsub
 xor a              ;subtract 39 to reset it
skipsub:
 ld (hl),a
 inc hl              ;playerdata+3 loads which direction to move the map (L, R, U, D)
 cp 10             ;10 means we've landed on jail, the lower left corner.  we can no start going a different direction
 jr nz,skip1
 inc (hl)
skip1:
 cp 20
 jr nz,skip2
 inc (hl)
skip2:
 cp 30
 jr nz,skip3
 inc (hl)
skip3:
 or a
 ret nz
 ld (hl),a 
 ret
The problem is that once I finally get a section working, I'm too sick of it to try and optimize it so I move on. Then later when I come back to it, I can't remember exactly how everything worked and don't feel like going through it again. Haha, I'm so lazy.
User avatar
Madskillz
Calc Wizard
Posts: 745
Joined: Fri 17 Dec, 2004 10:22 pm
Location: Wandering around in the Jungle...
Contact:

Post by Madskillz »

the 8k limit is only for code...remind you.

Plus isnt it like 8111 or something?

edit: 8192 bytes
The Revolution is here...
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Yea, I still will need to copy and paste all of the data sections to the end. It's not that so much as...dang this program is getting large.
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Last night I worked on it a little bit and decided to start optimizing some things. Well, I wrote my very own masked sprite routine (before, I was using one by James Vernon that also clipped sprites, which I don't need) and I cut down in some of the "non necessities" in the dice routine, and managed to clip off about 300 bytes. I've decided to start work on saved games and such (as custom-named appvars), as well as a rudimentary system for the different options.

For saved games, I was thinking of doing something like if you load a game and quit, it saves automatically. If you start a new game, it asks you if you want to save and if yes then prompts you to enter a name (my first input routine, self-coded :)). So if you load a game, you HAVE to save it; you can't just quit and restart.

Oh, and for the record kroot has me blocked on AIM.
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

Madskillz is correct, the limit is only for code, you shouldn't really be anywhere near that limit ... especially if you place any and all data at the end of your program. Also im pretty sure the limit is 8811b.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

8811? If that's the case I shouldn't have any trouble optimizing it occasionally to keep it low enough not to bother. And yea, it would just be a matter of setting the include for the board data at the end of the includes, it's just nice having them in alphabetic order (I'd have to come up with a new name for it :P).
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Hm... I started work on the saved games, and I must say that it was much easier than I thought. The input routine took about 20 minutes to write, creating the appvars was simple (although I had to define the romcall, cause it's not in ion.inc), but there was one problem. I had to use one of those IFDEF 83P things, because the 83 doesn't have appvars! So how should I store data for the 83? I could make it so that you can only have one saved game, then append the saved game data to the end of the program... But that's too boring. I could save it into a custom-named, hidden list, perhaps. It might make more sense to just append it to the end of the program, though, as the 83 has far less memory.

Thoughts?
CompWiz
Calc King
Posts: 1950
Joined: Thu 13 Oct, 2005 1:54 pm
Location: UB

Post by CompWiz »

the 83 has more ram than the 83+/SE etc, so it should be able to handle a small savegame easily.
In Memory of the Maxcoderz Trophy Image
Post Reply