Dark&Under - A Dungeon Crawler

(Darrell) #61

Great write-up. Really enjoy reading about the development process!

(Lan X33) #62

Arduino: 1.6.8 (Mac OS X), Board: “Arduino Leonardo”

/Users/21shangenh/Desktop/Dark-And-Under/DarkUnder_Play.ino: In function ‘uint16_t playLoop()’:
DarkUnder_Play:56: error: passing ‘const Item’ as ‘this’ argument of ‘void Item::setEnabled(bool)’ discards qualifiers [-fpermissive]
exit status 1
passing ‘const Item’ as ‘this’ argument of ‘void Item::setEnabled(bool)’ discards qualifiers [-fpermissive]

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

I download it again, and it still shows the error. And I also want to make sure that is it ok to use board “Arduino Leonardo”?

(Pharap) #63

Firstly, to everyone suggesting gameplay changes, new features or memory savings:

Please remember that we worked on this game nearly every day for several weeks straight,
that we had a deadline, that we had (and still have) things to do outside of doing this (jobs, family etc)
and that we were all in different time zones.

This has been a very tiring project.
We could all do with a break, and most of us have already set our sights on new games.

We will listen to suggestions, but please don’t expect us to add them in a hurry.

I’m not a big fan of the implicit casts to bool and pointer arithmetic instead of indexing, but otherwise it’s interesting.

We’d have to start packaging a local modified copy of Arduboy2 though.

I was intending to make an unofficial mod that turns the N, S, E, W indicator into arrows at some point.

I’d love to make it an official option or even the default option.

I completely agree.
I’ve got a feeling we discussed it at one point but I could be wrong.

The floor is a completely static image to save space.

@Luxregina might be on to something with the alternating floor, but personally I think that’s a lot of memory to use for something that can be solved by looking at the map.

Actually, I though about this many weeks ago.
There are some things we could do to make it more obvious:

Option A:
Option B:
Option C:
Option D:

(Ignore the S, those are all facing north. Naturally they would rotate to match the direction.)

I like the idea of a new creature or item, but not so much the rope idea - on top of adding a new item type and new image for the rope it means changing the world rendering, the movement logic and possibly a new image for the crevasse, which would probably add up to it being surprisingly expensive.

If the Arduboy had a microSD and we could store things on disk and then stream them into memory as required, the game could be a lot fancier.

(Pharap) #64

What are you using to compile?
Something other than the Arduino IDE?
Using the Arduino IDE that should be a warning, not an error.

It says “Arduino 1.6.8”, if that’s the Arduino IDE version you might want to update that, the current version is 1.8.5.

(I just remembered why that warning isn’t fixed. The moral of the story is to communicate better and don’t commit to master - use forks and branches.)

(Pharap) #65

Dark & Under has been updated to version 1.0.1, which adds devkit support (as requested by @darrell).

I’ve also made the pull request to add it to @eried’s repo.
(I didn’t realise it hadn’t been added, thanks for noticing that @Keyboard_Camper.)

The PR has been merged. Dark & Under is now available from eried’s repo.


FYI pointer arithmetic hasn’t been added by my changes. I have re-worked the function to handle the same cases in a more compact way. As for the implicit casts to bool I am not 100% sure what you are referring to. If you are talking about this line uint8_t *mask_ofs = !mask ? (uint8_t *)bitmap : (uint8_t *)mask; then !mask is not an implicit cast, it’s an expression which evaluates to a boolean without a cast.

Yes, not a big fan of that either in general but on the other hand it means the game will compile against a known version of the library instead of the one installed on the system at the time of compilation and my recent experiences with Arduboy development are making me reconsider my initial position. Given the constraints of the target system, relying on stock libraries may not be the best option because each game makes different tradeoffs between space and speed depending on its specific style/gameplay/taste. Additionally, the extra burden of including and managing changes to libraries is mitigated by git submodules so it may not be that bad at all.

I personally do not expect anything, just wanted to write down my comments while they were fresh hoping they would be useful. Thanks for your replies.

In order of preference for me: D,A,B,C

My 2c

(Pharap) #67

I was referring to this line: uint8_t *bofs = (uint8_t *)bitmap + initial_bofs; which I can see now is the result of splitting some old arithmetic in two.

I was under the impression that it was a case of an implicit operator bool which is then inverted through bool operator !(bool) rather than a bool operator!(T*), especially given that smart pointers in the standard library such as std::shared_ptr provide a operator bool but no bool operator !.
MSDN indicates that ! results in an implicit conversion to bool which is then inverted (“The operand is implicitly converted to type bool. The result is true if the converted operand is false; the result is false if the converted operand is true.”), but of course MSDN is not the standard.
If I get chance I’ll check which is the case.

I still think it would still be clearer as mask != nullptr though.

It would be more viable if said libraries had more compile switches (i.e. #defines) that could enable/disable features.

We’d have to look into those.
Out of the three of us I’m probably the one who knows most about git/github and I’ve never had cause to use a submodule before.

I’m not inherantly against the idea, it’s just that it’s a significant change so we’d have to discuss it and weigh up the pros and cons.

That wasn’t aimed at you specifically, it’s just that all the sudden suggestions for space savings and features people would like is a bit overwhelming considering we were hoping to release it and then be able to have a break and not have to touch it for a while (barring bug fixes).

If @luxregina and @filmote like the idea of making the map marker indicate direction, I’ll also suggest making a poll so everyone can have a say about which they prefer.

Thanks for replying though, if we know there’s at least some interest in making that change then it gives us a reason to discuss it.


Ack, I don’t mind either way. My reply to your comment was prompted by the use of the word cast. I just wanted to point out that a cast (i.e. an unconditional type change) is not involved so I do not believe the downsides usually associated with casts apply. I personally like the conciseness of (!ptr) but can see advantage of making the comparison explicit.

What bothers me in that line and the following one (now fixed see https://github.com/dxxb/Arduboy2/commit/87a66fca82815bbf133e3802bbfd2bbad3e7caa8) is the unnecessary casts to eliminate the ‘const’ modifier.

I went for minimal changes but it would be nice to re-org that code and its comments.

If the goal is not having to include modified libraries then changing #defines in the library’s source code is obviously not going to work and #defines in the game’s source code will not be enough (they apply to header files #include’d after the definition but not to the .c/.cpp compilation units). I have a possible solution in mind which involves adding an libraryname_config.h file to the game sketch but it depends on the Arduino’s build system include paths priority so it may not work.

I’d rather have as many function variants available (distinguished by name) and rely on the compiler to cull unused ones.

I imagined it but didn’t want to speak for others. You guys definitely deserve a break.

(Lan X33) #69

IT WORKED, thank you so much for helping, you are such a nice person.

(Scott R) #70

I am still amazed at how everyone continued to soldier on and meet the deadline, you even managed to slip in a Jam game.

The effort put into the game is very much appreciated and in my opinion this is one of the best Arduboy titles to date, for me personally its already become one of my all time favourite games.
Out of the box it has a sense of nostalgia and familiarity and yet is completely new I can see in years to come that when I think of the Arduboy this title will be one of the fondest memories that follow.

It’s great that you are willing to respond to user feedback and allow the game to further grow but yeah its time you all had an overdue break.

I should also add a “Thank You” to you all for allowing me to test the game it has been a real pleasure and honour.

(Pharap) #71

Which/what downsides?
static_cast and reinterpret_cast are generally pretty cheap.
(They may be less cheap for widening/narrowing conversions depending on the logic involved, but most conversions are fairly cheap.)
Admittedly dynamic_cast is expensive, but I can’t imagine many people using that on Arduino.

I concur. The constness should be maintained rather than casted away since it’s the pointed-to type that’s const, not the pointer itself.

I keep forgetting the Arduino IDE precompiles all libraries.
I’m used to using libraries that are source-only or don’t rely too heavily on .libs or .dlls (or .sos, or whatever the Linux/Mac equivalents are).

In the case of Arduino that’s probably wise.

A bit of SFINAE might also be able to help in places, though that might reduce the number of library maintainers. (Aparently some people really don’t like templates or SFINAE.)

No problem.
I’m just glad you got Dark & Under working.
I’m sure you’ll have fun playing it.

In fairness you helped with that since I wouldn’t have had time if we hadn’t got a dedicated tester in for the end, doing that meant the three of us could relax a little because we could spend a little less time testing the game ourselves.
(Plus I was the only one of us three who didn’t have a personal/family problem to deal with around that time.)

If people appreciate and enjoy it then it makes the effort worthwhile.

Balancing how much we allow it to grow will be difficult since we need to weigh up how much space we give to features and how much we give to letting people create their own levels.

But whatever we decide we will listen where we can.
(And of course, bug fixes get priority over features, though so far we haven’t had any bug reports (thankfully).)

As I said before, without a tester those last two weeks would have been much more stressful.

Also we’re thankful because you did a good job.

Some people think testing is just about playing a game and complaining about things breaking, but a good tester gives detail about the conditions when the bug occurred and the actions leading up to it, which is something you managed to do.

(Walter Lauer) #72

a damn great game…best Arduboy game,till now.

(Simon) #73

D for me!

I have run ahead and made the changes already - I guess I will discuss it with the other guys tomorrow (after all its still Christmas in some parts of the world, but not here in Oz).

Thanks @Mr.Blinky. I have made the change and hope to get it into V1.0.2.

(Simon) #74

Wow … thanks. I am glad you like it!

(Pharap) #75

Don’t forget that the day after Christmas is Boxing Day in some places. (Including here, the place it originated.)

(Simon) #76

And here … although it too is almost finished.

(cyril guichard) #77

So one day you spread the cheers, and the next you pummel thy neighbor’s face? :slight_smile:

(Scott R) #78

Nope just the kids who got noisy toys.

(Pharap) #79

How else would we make use of the boxing gloves we were gifted at Christmas?

In all seriousness though, it’s pretty much just an extra bank holiday.

Nobody is sure quite how it orginated, but I like the theory that it was the day that the upper classes thanked their servants for tending to them at Christmas by letting them go home to their families with a box of money and gifts as reward for their good service.

(cyril guichard) #80

I wasn’t :slight_smile: (serious!) I know of boxing day, even as a French guy, I managed to have English friends!!! :slight_smile:
Happy Boxing day, then!