Rogue-like ascii based on Arduboy


My teacher, @Pharap.

For the first time, I tried using GitHub. Am I doing right?

(Pharap) #162


(I was going to say “よくやった”, but aparently “たいへんよくできました” is what teachers say to students. I also thought about “お疲れ様でした”, but that seems a bit businessy.)

(By the way, -y and -ish are really useful suffixes (in English).)

(Simon) #163

Right … that’s such a Pharapy comment.

(Pharap) #164

I’m going to ‘fork’ your repo and then make a ‘PR’ (pull request) to demonstrate PRs:

A PR is how you accept changes from other people.
(There’s more to it than that, but I’m keeping things simple.)

This PR adds a new .gitignore rule that stops Excel lock files (e.g. ~$names.xlsx) being committed.
(It only works with command line git, GitHub will still accept them with direct upload.)

This was a simple change for demonstration purposes.

When someone has made a PR, you have four options:

  • Close the PR (reject it completely)
  • Create a merge commit
    • All the commits in the PR will be applied to your repo
    • An extra ‘merge commit’ will be added
  • Squash and merge
    • All the commits are turned into just one commit
    • An extra ‘merge commit’ will not be added
  • Rebase and merge
    • All the commits in the PR will be applied to your repo
    • An extra ‘merge commit’ will not be added

You can chose a merge option by using the down arrow here:

If you are unsure which merge option to use, just use the default one (i.e. press Merge pull request).
(Or you can close it if you want.)

I will explain more another time.
I want to keep things simple.


Yes, it’s very Pharapish.
In fact, it is the Pharapiest of all comments. :P

(Stephane C) #165

Looks like I can’t compile that version for some reason… Sketch uses 100% of program space…

I get the Sketch too big message. I know it’s probably because you are using Cathy3k.

I will find a way to compile for the default.

(Josh Goebel) #166

I see LOTS of room for space optimizations. So good news if the idea is to make the program smaller. :slight_smile: Let me know if you want my feedback.

(Stephane C) #167

I sure would love it to be smaller, but it’s BlueMax call not mine.

(Stephane C) #168

For now I managed for add back my sprites in and it’s all working but I simplified the game over and victory screen in order to compile it using 99%

(Stephane C) #169

For anyone interested, the gfx mod has been updated to match BlueMax release.

(Pharap) #170

I didn’t check that.

You could try incorporating the big reduction I made earlier with the strings.
I see that hasn’t found its way into the actual program yet.
(I don’t know if it will still save 10% of progmem, but if it does then you should be fine.)

I can see quite a few savings, but I don’t want to force them in.
As you say, it’s @BlueMax’s decision.

(Josh Goebel) #171

Just also forked. If the author proves receptive (and responsive) to GitHub PRs I might whip up a few simple things.


Thank you, @Pharap!
“一日一歩” — One step per day.:slight_smile:

Sorry, @Vampirics.
I downloaded the source and compiled it on caterina bootloader. I do not know why.

Thank you, @Dreamer3!
I am a lazy student. I do not understand half of what @Pharap taught me. I am a beginner of the program and it is difficult to understand English. “Rogue” is my first program. Perhaps, I will not understand half of what you teach.
This program is MIT license. You can freely modify this program. And you can also incorporate new features. To be able to play that game is my pleasure.

(Josh Goebel) #173

Well as the author you have the “canonical” copy though. I might be interested in contributing but I don’t know that I’m interested in forking the project and then having to maintain/enhance my own tree forever. So a lot will revolve around how into the GitHub PR culture you get and how willing to accept other peoples changes into YOUR copy of the code.

That’s the PR way. :slight_smile:


Sorry, @Dreamer3.

I am a beginner as well as programs and English, as well as GitHub. Please teach me various things.

(Pharap) #175

If there is something you don’t understand,
please ask for another explanation,
I will try to explain it better.



(Stephane C) #176

That’s ok, I managed to save some space and compile it. I really like the addition of the traps. Makes it more dynamic and make us use the search action even more :wink:

In my fork I got rid of the continue option on the title screen since I don’t see the point. It feels like cheating more then resuming play.

Even with the little cut here and there I am at 99% so nothing much can be added without really working on rewriting parts of the code.

You should have a look at how @Pharap saves 10% of progmem with the use of strings. That might give us enough space for proper saving or maybe adding something to enter our name?

@Dreamer3 didn’t you have a rogue that you were working on? Zigclimb or something? Was looking forward for that.

(Josh Goebel) #177

Just got the latest code (with a few fixes) to compile. Size of top 24 functions objects:

00012008 00000198 T clearKnown()
00017032 00000200 T buildStructure(unsigned char, unsigned char)
00017854 00000202 T teleportHero()
00024374 00000212 T wield(unsigned char)
00015382 00000252 T Font5x7::write(unsigned char)
00019018 00000256 T drawThing()
00016002 00000262 T wakeUp()
00011250 00000270 T drawMonst()
00022370 00000280 T placeMonXY(unsigned char, unsigned char, unsigned char)
00015634 00000280 T hitWand(unsigned char, unsigned char, unsigned char, unsigned char)
00023752 00000314 T findPlace(unsigned char, unsigned char, unsigned char)
00011668 00000340 T drawMap()
00023400 00000352 T checkMonst(unsigned char, unsigned char, unsigned char, unsigned char, unsigned char)
00022728 00000388 T checkHiScore()
00016264 00000390 T sortItem()
00017232 00000622 T makeRoom(unsigned char)
00021456 00000868 T placeThingXY(unsigned char, unsigned char, unsigned char)
00018056 00000918 T tweatHero()
00020464 00000966 T Sprites::drawBitmap(int, int, unsigned char const*, unsigned char const*, unsigned char, unsigned char, unsigned char)
00009540 00001540 T heroMove(unsigned char)
00006926 00002614 T buildDungeon()
00012332 00002626 T moveMonst()
00024586 00003534 T main
00002730 00004030 T inventry(unsigned char)

Main is obviously inlining loop and some of the main states, you’d have to flag then as no-inline if you wanted to see their individual sizes.

Lots of pretty fat functions there at the end. What are we using drawBitmap for? Are there bitmaps sprites in the game?


To @Vampirics.

I tried incorporating the code that @Pharap taught into my program. It was about 500 bytes free memory. (30.4 KB)

To @Dreamer3.

Perhaps, I think that I am using it to display fonts. I am using @filmote’s “font4x6” modified.

(Simon) #179

That’s right … usually the overhead of drawBitmap() is not an issue for most games as they are using it in one form or another (drawOverwrite(), drawSelfMasked(), ...) but in an all ‘text’ game it is a large chunk of code.

If you are using Sprites::drawOverwrite() and Sprites::drawErase() change it to SpritesB:: (in fact everywhere you use Sprites:: change it to SpritesB::). It may save a few hundred bytes or more!

(Simon) #180

I just grabbed @Vampirics code from GitHub ( @BlueMax is yours available?) and swapped Sprites::` forSpritesB::``` in the two locations it appears. It save 366 bytes at compile time.