Dark&Under - A Dungeon Crawler


(Simon) #41

OK … not sure how he ‘7’ comes into it.

I have implemented it and we are deciding whether to release it as it may screw up some peoples level design efforts(assuming people are actually using the designer).

const uint8_t *tile = tiles + (tileNumber * MAP_TILE_WIDTH * 2);

… and it seems to work fine. Thanks that’s 68 bytes saved!


#42

integer divisions are rounded down. So to round up you add the divisor-1 before the division. A byte holds 8 bits so the number to add before the division is 8 - 1 = 7.


(Lan X33) #43

HELP, just got my little Arduboy, and want to get some good games, but the error shows up

Arduino: 1.6.8 (Mac OS X), Board: “Arduino/Genuino Uno”

/Users/21shangenh/Desktop/Dark-And-Under/DarkUnder_Play.ino: In function ‘uint16_t playLoop()’:
DarkUnder_Play:56: error: ‘ture’ was not declared in this scope
(myLevel.getDoors()[i]).setEnabled(ture);
^
exit status 1
’ture’ was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

So, a little help?


(Scott R) #44

First you will want to change your board type

Select Tools —> Board —>Arduino Leonardo or Arduboy


(Lan X33) #45

Take your time, thank you so much.


(Scott R) #46

You can checkout the following quick start guide here Quick Start Guide and also Learning to Program the Arduboy


(Pharap) #47

That’s sort of what I meant by the “gets out operator associativity table” joke. Without brackets, a multiple-operator expression is effectively a test of how well someone has memorised the operator associativity table (identifying operator order and directional associativity).


(Pharap) #48

That sounds like you’ve accidentally typed something that’s changed the source code.
Try getting a fresh copy and making sure you don’t accidentally type anything into the source.


#49

Lolz it was a joke? I thought you got some some kind of compiler error :smile:


(Pharap) #50

If it was a compiler error I’d be putting it in a quote block or a code block, as well as including the line number and a guess as to what the problem was if I couldn’t already figure it out. (i.e. the things you’re supposed to do when reporting an error :P.)


#51

I optimised Sprites::drawBitmap() for size (see https://github.com/dxxb/Arduboy2/tree/sprites_dash_Os) and it saves 360 bytes, gameplay is unaffected as far as I can tell (the game has cycles to spare so slowing down rendering to a degree doesn’t really matter).

Before

Sketch uses 27764 bytes (96%) of program storage space. Maximum is 28672 bytes.
Global variables use 1862 bytes (72%) of dynamic memory, leaving 698 bytes for local variables. Maximum is 2560 bytes.

After

Sketch uses 27404 bytes (95%) of program storage space. Maximum is 28672 bytes.
Global variables use 1862 bytes (72%) of dynamic memory, leaving 698 bytes for local variables. Maximum is 2560 bytes.

drawPlayerVision() would seem to me to be the next target for size reduction.

Great game BTW, well done! Unrelated to size reduction, my comments about the UX follow (even if no one cares :rofl:):

  1. I would have swapped the mini map and player attributes position on the display. I am finding that having to scan text (player stats) to reach the mini map requires more effort. I guess my brain is weird.
  2. The player could be indicated by a triangle in the mini map conveying orientation. Again having to read NSWE seems to require me to engage another part of my brain.
  3. I wonder if the down button should make the character walk backwards instead of turning. I say so because while UP moves the player forward, LEFT/RIGHT turn the character 90 degrees and DOWN turns the player 180 degrees and I find this sort of unexpected. Maybe it’s because the graphics doesn’t hint that a 180 degrees turn just occurred by when I press DOWN I instinctively assume I walked backwards then remember that I actually turned. Is it only me? Did I play too much DOOM and Castle of Wolfenstein back in the days?
  4. I wish the ceiling and floor had patterns which moved towards the player to hint at movement.

(Scott R) #52

Not at all I always ignore the down button and navigate by double tapping left or right.


(cyril guichard) #53

We do care!!!

Here’s a mock-up of what you ask, and my thoughts:
mockUp

  • the triangle idea could not work because the player marker is 2x2 pixels and the tiles 4x4 - so there’s no way to center that middle pixel, therefore the angle seems off
  • Switching the minimap and the stats is an idea, but we would have needed to lose the florish (folded corner) as it overlaps too much to put the stats in the right-hand window.
  • Ceiling and floors: I agree with you - maybe if we can claim some memory back I can provide an alt graphic that gives the illusion of movement… at that point, it was not critical and we were so starved for memory…
  • the back button: I tend to agree with you - another part of me like the “quick turn-around” effect of it, even though I agree it can be destabilizing!

(cyril guichard) #54

Actually, I wonder if flipping horizontally the floor and ceiling every other step wouldn’t be enough to give that illusion of change, therefore movement… without adding any additional weight - something I might try after Xmas!


(Scott R) #55

it’s crazy but the mini map has the impression of being larger in this area.

Edit:
I do feel it’s a little busy with it centred tho.


(cyril guichard) #56

well, the middle area is a couple pixels larger than the right one.
Yes, I prefer the map on the right, in its original position, but it was worth a try! (I sincerely didn’t think of it when I designed the UI)


#57

@Pharap You can save another 22 bytes by combining the direction images

Dark-And-Under remove:

const uint8_t *direction_images[] = { directionN, directionE, directionS, directionW };

and change drawDirectionIndicator:

Sprites::drawSelfMasked(DIRECTION_X_OFFSET, DIRECTION_Y_OFFSET, direction_images, (uint8_t)myHero->getDirection());

images_base join images:

const uint8_t PROGMEM direction_images[] = {
12,  17,
0xff, 0x01, 0x01, 0xfd, 0xfd, 0x0d, 0x0d, 0xfd, 0xfd, 0x01, 0x01, 0xff, 
0xff, 0x00, 0x00, 0x8f, 0xcf, 0xe0, 0xe0, 0xcf, 0x8f, 0x00, 0x00, 0xff, 
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 

0xff, 0x01, 0x01, 0xfd, 0xfd, 0xcd, 0xcd, 0xcd, 0x0d, 0x01, 0x01, 0xff, 
0xff, 0x00, 0x00, 0x8f, 0xcf, 0xec, 0xec, 0xcc, 0x8c, 0x00, 0x00, 0xff, 
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 

0xff, 0x01, 0x01, 0xfd, 0xfd, 0xcd, 0xcd, 0xcd, 0xcd, 0x01, 0x01, 0xff, 
0xff, 0x00, 0x00, 0x8c, 0xcc, 0xec, 0xec, 0xcf, 0x8f, 0x00, 0x00, 0xff, 
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 

0xff, 0x01, 0x01, 0xfd, 0xfd, 0x81, 0xc1, 0xfd, 0xfd, 0x01, 0x01, 0xff, 
0xff, 0x00, 0x00, 0x8f, 0xcf, 0xe7, 0xe3, 0xcf, 0x8f, 0x00, 0x00, 0xff, 
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
};

#58

Nice trick, it might work.

Thanks to both of you for considering my comments and replying. I see now why the mini map is on the right and agree a directional player marker wouldn’t look well on a 4x4 tile.


(Simon) #59

Bowing to popular demand - inculding @luxregina - I will discuss with the team about making the down button simply move the character backwards.

That is awesome … combined with @Pharap’s 100-odd byte saving in the drawCompressed, we may even be able to include sound!


(Scott R) #60

With all the space saving that’s going on as nice as it is is sound really the best use of it? I ask because personally I consider sound on a game of this style “gloss”, I would rather see expanded gameplay features for example: a rope item that’s required to cross a crevasse or additional creatures (manticore, giant spider).