Stuck In Rogue
A downloadable game for Windows and Linux
You are a game developer trapped in your own rogue-like!
Reach the exit to free yourself.
Make use of an in-game scripting language and development environment to program entities to behave as you see fit.
CONTROLS :
move: WASD or left click
connect to entity: right-click
cycle through connected entities: TAB
wait/move along path: SPACE
controls can be remapped in the "controls" menu
Made for 7DRL 2025 using ebitengine, as well as my personal UI library and my unnamed scripting language I've been developing for another project .
note: while the "7drl" version of this game is playable, its quite buggy, and has some major usability problems. As of March 13th I've uploaded an updated version of the game with a lot of bug fixes and improvements. The "postjam" version is strongly recommended.
Updated | 11 days ago |
Status | Prototype |
Platforms | Windows, Linux |
Author | Arkanar Systems |
Genre | Adventure |
Tags | Dungeon Crawler, Roguelike, Roguelite |
Average session | About a half-hour |
Languages | English |
Inputs | Keyboard, Mouse |
Accessibility | Configurable controls |
Download
Development log
- Stuck in Rogue (an 11 day rogue like)43 days ago
Comments
Log in with itch.io to leave a comment.
nice update! I still have a lot of 7DRLs to review but I wanted to poke around with the updates. GUI seems a good deal less buggy (though, I didn’t tinker with the terminal much).
I have some theories on how the scripting + uploading works, let me know if I’m off base..
step
function of an entity receives as args a entity (“self”?) and a list of tiles the entity can see.step
returns a map, which gives a game action (like “heal” or “attack”) and a tile coordinate to do it to.Which means:
step
(“spideybro” or the like) but I must have done it wrong orent
is read only.I’m looking forward to some other interactions (maybe docs for the
cmd
output map? Could my entities perhaps use the steps, and resume their hacked programs automatically once I follow them down?)I imagine I would eventually write scripts for an enemy to follow me as long as only “bros” (turned enemies) are around, but engage others. I’d also like to do some stuff like “langston’s ant” or “bugs barfing pheromones onto the map” to try to literally stand wherever I spawn until somebody finds the exit. It may not require adding info to the map (just follow the left-hand-on-the-wall rule?) but multiple entities could split the search work if they had a way to communicate. An actual “wifi” or “shared map” for entities would enable other advanced behavior.
[edit:] I guess my specific requests for this idea are: some spawn ability (maybe take a filename as an argument, so I can write a ‘pheremone.:’ script) and an example for either reading/writing variables from an entity in fov, or another map passed as a variable to
step
which is shared by every entity and persists between rounds.I doubt any of this would ever be necessary to win the game, but that’s not how sandboxes work…!
you've pretty much got it figured out.
although the scripts aren't technically run at the time of upload, its just that uploading a script uses one of the player's energy points, which then triggers a world step to occur.
for each world step, for each entity, I first call into the its scripts "step" function passing a map that represents an entity (the format is specified in docs.: ) (since you've already played the game you might have select "restore default files" from the settings to see the changes) and an array of tiles in the entities fov. while each tile does contain the data of an entity, and you can technically change it, the changes are local to the function call. So changing the "tag" property of the entity map doesn't effect the data in the field of view. Basically, everything that goes into and out from a function callback is passed by value.
all (non player) movement is handled by the "goal" command. I find the the shortest path (A*) from the entities position to the goal and update its path which in then follows until the "goal" is overwritten, is reached, or the entity collides with another entity.
so, after "step" is called, the entity attempts to move along this path.
If a collision occurs I call into the "collide" function (added in the updated verison) which is the same as step except it contains a third argument representing the entity that is in the tile it wants to move into.
The wander code is actually very simple. Entities have a "goal" property that only exists in the map if their goal is already set. So, in the step function, I check if the entity doesn't have a goal, then I loop through every tile its field of view adding all non wall tiles to a list of possible tiles to move to, I then select one at random using the built in 'rand function, and assign the the tiles "pos" property to the "goal" command.
Then (outside the script) the shortest path from the entities position to the "goal" is calculated using A*. So even though there are edge cases where a non-reachable tile is in the field of view, if that tile is chosen the entity simply wont be assigned a path and the script will pick a different random tile the next time "step" is called.
I did change how "heal" works, so now it does take a position. The amount that it heals is now based on an entity's "strength" stat.
The main thing I forgot to mention in the docs in this update was that you can see print statements in the terminal from the scripts of entities you are connected to. So to see the exact layout of the entity map that's passed to step you can upload this script to an entity:
: step ( ent
$ ent
)
you've correctly identified the limitations. That is, there's no direct communication between entities, entity's tags cannot be changed, and you can't pass arbitrary data to entity's scripts. This is something I've already thought a lot about. I already implemented this kind of functionality in my other project that uses this scripting language so its certainly possible, but its a very different game.
I actually just started a new project based on Stuck In Rogue, that is more focused around networking. I'm planning on making it so not only the player, but every entity is able to connect to other entities and modify their scripts or give commands directly. I've been working on terminal cmds for uploading, downloading, connecting, scanning for possible connections, etc. and then all I'll have to do if allow entities to issue commands to the terminal. I also plan on including the ability to spawn items, but I'm still thinking of how that might work.
I probably wont be adding these features back into Stuck in Rogue in as the new codebase is already diverging. But I might go back and add more detailed documentation.