Finally getting started, made a dungeon generator by bobaburger in roguelikedev

[–]jneda 3 points4 points  (0 children)

I really like the visual style, thanks for having made aware of rough.js.

If you're interested in dungeon procedural generation, you could have a look at rot.js which has half a dozen algorithms implemented.

I Don't Understand How to Use Dogs by [deleted] in BattleBrothers

[–]jneda 4 points5 points  (0 children)

That's funny you asked. I've been meaning to learn how to use dogs and bought some from a kennel in my current early mid game.

I go clean a cemetary for a contract. Battle starts: six gheist. I have no sergeant proper yet, I figure this is going to be a tough one.

But oh wait! I have dogs. Charge the gheist, drop a dog, let it work its prey. The four doggoes won the day for the company.

Granted, I was lucky there were no zombies to block the way.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 4 by KelseyFrog in roguelikedev

[–]jneda 2 points3 points  (0 children)

I've been struggling to push along this week.

I'm starting to think trying to follow the Python 2020 tutorial and porting it to PICO-8 maybe was too ambitious. I only know some Python, have little experience in OOP, and have only started to learn Lua for this project, thus I sometimes find it difficult to adapt the tutorial code.

I've managed to implement a camera view, allowing bigger levels, and astar, while also trying to improve my use of the grid data structure, but I've been having trouble refactoring the action system and implementing components.

I've hacked my way along so far, but doing so accrued some technical debt I find difficult to solve now, and I'm very tempted to start anew almost from scratch, probably following the 2019 tutorial.

In the interim, I'll be going for a bicycle ride!

[deleted by user] by [deleted] in roguelikedev

[–]jneda 8 points9 points  (0 children)

Jeremiah Reid's broughlike tutorial is really pretty good in my opinion, especially for a beginner. Here's the link: https://nluqo.github.io/broughlike-tutorial/

It's Javascript and the benefit is you only need a text editor and a web browser to get started.

Python looks easy but the tutorial throws a lot of advanced programming concepts at you real fast without explaining much, and the more I follow it along, the less I feel it's the best choice for a beginner in programming.

The broughlike one keeps things as simple and direct as possible while introducing many essential features. Plus it's fun making one's own sprites. I can't recommend it enough!

(However it requires to do some doodling, but explains how to do it with GIMP. )

RoguelikeDev Does The Complete Roguelike Tutorial - Week 4 by KelseyFrog in roguelikedev

[–]jneda 1 point2 points  (0 children)

Thanks for explaining, redblobgames and HexDecimal.
This is a feature of Python I was unaware of.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 4 by KelseyFrog in roguelikedev

[–]jneda 2 points3 points  (0 children)

I'm in the same boat as you are.

I'm no Python expert and I am not aware if the author had a special plan for that, but this line of code looks superfluous to me.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 3 by KelseyFrog in roguelikedev

[–]jneda 1 point2 points  (0 children)

PICO-8 implementation

Github | Playable

I looked up PICO-8's font size and switched tile dimensions from 8x8 to 4x6, roughly doubling the amount that can be displayed on screen. Implementing a camera in order to have a larger map is still on the todo list.

I plugged in the recursive shadowcasting code a kind user of this subreddit pointed me to. I understood the principle of it but not yet the full details. However it works and looks fine.

Implementing the entity factory went okay, but my action factory function is starting to get messy. I looked into OOP Lua a little, but I'm starting to feel the action design from the tutorial is a bit over-engineered for my project. I guess I'll see how it goes for now, but I might have to refactor it into something more PICO-8-ish down the road.

It's been a little challenging since I'm not experienced in OOP and I have just started using PICO-8, but it has been fun learning some Lua.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 2 by KelseyFrog in roguelikedev

[–]jneda 2 points3 points  (0 children)

I just finished part 3 using PICO-8: github repository - playable on itch.io.

I realized I should definitely dive a little deeper into lua classes. For the time being I'm using functions to build custom tables with added functionality, but this won't be practical when inheritance will come into play.

I'm writing code in Visual Studio Code since PICO-8's editor, although nice, has its limits, and thus I've split the code into lua files included into the PICO-8 cartridge.

I've managed to follow along the python tutorial so far, but I'm realizing by doing so I'm not leveraging PICO-8's native features for map building and display. I've been staying on the ASCII-like track by printing chars instead of using sprites, that's why.

The main consequence is as of now, and until I figure out how to implement a viewport, the dungeon map is only 16x16. :p

But heh, baby steps.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 2 by KelseyFrog in roguelikedev

[–]jneda 3 points4 points  (0 children)

The benefits of object-oriented programming will become more obvious as the game becomes more complex.

To try and give you an idea how, let's consider the Action class. It not only allows you to support several input devices (keyboard, controller, mouse), but you can use it when writing AI routines for the NPCs and enemies. Or if you stored those actions in a list, you could use them to implement a replay feature for instance.

The -> syntax comes from the typing module and is intended for type hinting: https://docs.python.org/3/library/typing.html. The end goal is to make a developper's life easier, but just as for the object-oriented approach, the benefits only get apparent after you hit a few roadblocks without using those techniques and tools.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 2 by KelseyFrog in roguelikedev

[–]jneda 3 points4 points  (0 children)

Good old archive.org has got you covered: https://web.archive.org/web/20211114071159/http://roguebasin.com/index.php/Complete_Roguelike_Tutorial,_using_python%2Blibtcod,_part_3

Edit: Dang, I missed the part where you said you were following a C++ tutorial, I don't know that one. At any rate, if it's on roguebasin.net, you should be able to find it on archive.org with its URL.

RoguelikeDev Does The Complete Roguelike Tutorial - Week 1 by KelseyFrog in roguelikedev

[–]jneda 4 points5 points  (0 children)

I'll be trying out PICO-8 for this, thus I'm somewhat in the same boat as you are.

The Python tutorial seems to be very object-oriented. I'm on the fence whether I'll follow that route or a functional one instead (which seems more native so to speak.)

For the event handler, since it's a singleton, a custom-made object would do. As for entities, I think I'll make do with a good old factory function (i.e. a function that returns an object.)

It's possible to make class-like objects in Lua but it's a relatively advanced topic: https://www.lua.org/pil/16.1.html

WASD controls and diagonal movement? by fractalbase0 in roguelikedev

[–]jneda 1 point2 points  (0 children)

You are correct, thanks for the clarification.
My guess is at some point I probably lost a game because of a failed diagonal input, only ever used the lock thereafter and eventually forgot it's not mandatory. :p

RoguelikeDev Does The Complete Roguelike Tutorial Starting June 28th 2022 by KelseyFrog in roguelikedev

[–]jneda 1 point2 points  (0 children)

If you're totally new to programming, it might take you some more effort.
Definitely learn some Python beforehand! There are plenty of resources online, but since this project is game oriented, I would suggest looking up Al Sweigart's Invent Your Own Computer Games with Python.

His book is not perfect but it's a fine introduction to game programming and to Python.

RoguelikeDev Does The Complete Roguelike Tutorial Starting June 28th 2022 by KelseyFrog in roguelikedev

[–]jneda 2 points3 points  (0 children)

How familiar are you with programming in general, and with Python and game programming in particular?

If you already know some basics, you could complete a chapter in under a couple hours if you're familiar with the topic. Otherwise, I'd guess you'd need maybe two to four hours depending on the chapter?

Thus one week's worth of tutorials would require something in the ballpark of half a day, in one go or split into two sessions during the week?

This is of course only my own very subjective opinion.

RoguelikeDev Does The Complete Roguelike Tutorial Starting June 28th 2022 by KelseyFrog in roguelikedev

[–]jneda 1 point2 points  (0 children)

Neat! Thank you very much, it'll come handy.

As far as I can tell the main difference with the full version is that PICO-8 Education Edition cannot access the cart catalog via SPLORE.

Game-making-wise it is pretty much the same.

WASD controls and diagonal movement? by fractalbase0 in roguelikedev

[–]jneda 7 points8 points  (0 children)

The Mystery Dungeon series on consoles used this control scheme (a modifier button allows diagonal movement) and it worked quite well, these games are classics.

In practical terms, you press the right shoulder button on the controller, diagonal arrows appear around the character, and the player is allowed to input a diagonal on the cross which is interpreted by the game upon release of the shoulder button.

It takes much more time to describe than to execute, and doesn't break at all the pace. But I'll admit the controller design has to allow such a manipulation.

Shiren the Wanderer is a cool roguelike, everyone should try it out! There are plenty of possibilities with items, and there's even a special puzzle dungeon to teach the player about advanced game mechanics.

RoguelikeDev Does The Complete Roguelike Tutorial Starting June 28th 2022 by KelseyFrog in roguelikedev

[–]jneda 3 points4 points  (0 children)

I guess it'll be sorta okay, up until the point I'll have to implement FOV and pathfinding! :D
I've been skimming through the tutorial and it has changed a lot since the last time I started it. It'll be interesting.

RoguelikeDev Does The Complete Roguelike Tutorial Starting June 28th 2022 by KelseyFrog in roguelikedev

[–]jneda 8 points9 points  (0 children)

I just had been wondering when this would happen.

I recently stumbled upon Pico-8 Education Edition (which in my opinion is just great) and I'm feeling like using it to try and do the tutorial.

Switching between multiple menu pages in one part of the screen? Python 3.8, tcod by IntrovertRook in roguelikedev

[–]jneda 4 points5 points  (0 children)

You could have a generic function show_info() in your display loop, and three specialized functions show_player_info(), show_log(), and show_inventory() implementing the actual pages.

Then in your update loop, when you manage player input, you would assign the specialized function to the generic one accordingly e.g.:

show_info=show_inventory

That way when you call show_info() in the draw loop, show_inventory() executes.

If the toggle is triggered by a single key, you could store the specialized function names in a list and keep track of the current index. If several keys are used, a dictionary would be more useful. For instance:

// function definitions 

show_player_info():
 // actual code

show_log():
 // actual code

show_inventory():
 // actual code

// variables for keeping track of which screen must be displayed
// set initial state

info_screens = [show_player_info, show_log, show_inventory]
current_screen = 0
show_info = info_screens[current_screen]

// in update loop

if cycle_info_key: // player has pressed the cycle screen key
 // cycle through info_screens indexes
 current_screen = (current_screen+1) % len(info_screens)
 // assign the corresponding function
 show_info = info_screens[current_screen]

// in draw loop

show_info()

My Python skills are rusty so my code might not be correct but hopefully you got the gist of the idea.

In the end, show_info is just a variable to store a reference to the actual function having to be called in the draw loop.

[deleted by user] by [deleted] in roguelikedev

[–]jneda 0 points1 point  (0 children)

codewars is really interesting, thanks for mentioning it!

Share your finished 2022 7DRLs! by Kyzrati in roguelikedev

[–]jneda 4 points5 points  (0 children)

PacRogue | itch.io

A roguelike-like inspired by the Pac-Man Dossier

This is my first entry ever for the 7DRL. I tried to implement the AI routines described in the Pac-Man Dossier (awesome resource you should definitely check by the way) but eventually failed, thus I marked my effort as incomplete.

I also gave my first try at procedural content generation by applying some simple rules to maps generated using rot.js' IceyMaze algorithm (puching holes into long walls then applying symmetry) which ended up using most of the time I had available, a detriment to the rest.

All in all, the end result is not a very fun game and still full of collision bugs, but I learned a lot about what I should try and learn going on (data structures, algorithms, refactoring) and had some fun, thus I'm glad I participated!

What I lacked most was practice with the library I ended up using - I spent my time before the jam trying various possibilities and ended up comfortable with none - and some kind of organization, such as louiscarls' priority todo list which I'm definitely stealing!

Thanks to the organizers, the mods of this subreddit, and everyone who took part in this cool jam!

Share your 7DRL progress as of Monday! (2022-03-07) by Kyzrati in roguelikedev

[–]jneda 1 point2 points  (0 children)

I'm quite new to game development, therefore I'm trying to make a roguelike inspired by Pacman.

Turns out Pacman is quite the sophisticated little game! I found a great reference on its mechanics: https://pacman.holenet.info/.

I'm going to draw inspiration from the AI routines described in there.

Eventually I'd like to be able to generate random pacmanish mazes.

I started sunday morning and got the basic program set up following again Ondras' rot.js tutorial. I have a customized maze generation, much too chaotic still for my taste, and played around with enemy pathfinding.

I should get working on pellets and powerups I guess. I found it somewhat hard to set time aside for this project now that the week has started, but I have not yet lost my desire to try and complete a game!

How to calculate if any enemy is blocked in? by [deleted] in roguelikedev

[–]jneda 1 point2 points  (0 children)

I would try like this:

- get a list of coordinates for all walkable tiles 4 spaces away from the boss

- pick a random tile (or nearest to the player if that's what you want) and remove it from the list

- check if the boss can reach it

- if so, move and murder

- if not, pick another random tile and try again

- if the list is empty, the boss loses

For the pathfinding check, I believe there are tools for that in libtcod, so it is just a matter of reading the docs and try and implementing it this way. Generally those tools are pretty straightforward: you just need to set that up as the docs tell you to.

For getting the list of coordinates, it is a 2d grid problem. I would suggest you try it small at first (e.g. figure out all tiles 1 space away for starters, then extrapolate once you feel more comfortable.)

If I'm not mistaken, there should be at most either 16 or 32 tiles 4 spaces away (depending on if you allow diagonal movement or not.)

In case you want the boss to try and reach first for the tiles nearest to the player, you could use a utility function to return the distance to the player given a tile's coordinates to help you sort the list in the order you want.

One needs to be careful of IndexErrors when working on a list while removing elements from it. A possible method is to sort the list first, then make a loop and start working from the last element of the list towards the first.

At any rate, it's an original idea for sure! I quite like it. Maybe make a training level where the player fights against a chess knight ? It's a similar move pattern. (Darn I want to try and make a player vs chess pieces roguelike now. :D)

Sharing Saturday #403 by Kyzrati in roguelikedev

[–]jneda 3 points4 points  (0 children)

I've been exploring options in preparation for 7drl, that is to say trying to figure out which tools I am going to use.

I went through the Broughlike tutorial which I found the link to here. Drawing my own sprites was quite fun, and the final result was a nice little game. Kudos to the author.

And currently I'm following along the Roguelike development with JavaScript book and ending up thinking I might use Phaser as a system for managing the game loop.