January 2017 Game Dev: 2D PCG ARPG

I am in agreement.
I had more fun playing the the v1 prototype with the simple room than the current implementation.

The map gen was made for a different project out of idle curiosity, rather than made for this specifically.
It event started life as a new project that was then imported into this. Remove it from the current project and I will look at adding it into something else.

Procedually generated dungeon/building all the way.
I have some mechanical ideas in my head that I would like to try, but I am not sure how to…

Edit: Difficult to write with my son running around, He is taking a nap now so i can finally post, but I must be brief.

The Idea I now have in my head I am tentitively calling ‘House of Jinn’.
It is set in a large procedually generated house (I have an idea for map-gen that I would like to quickly prototype) where the player wakes in a bedroom with no idea of how he got there. The house is dark and seemingly abandoned.

A Jinn is roaming the house searching for the player, the player must move around the house avoiding it and hiding while searching for keys/tools to help him escape.

Throughout the game the player finds pages of a journal that detail the life of the houses owner and the choices he made in his life that caused him to lose everything and empower the Jinn in his home to become so strong.

What do you think?

We already have player movement + collsion.
If I work on game mechanics like map-gen + AI, could you focus on story and objectives?

What I am imagining as far as interface goes, we have what we basically have now with the squares and tiles, but add a section below screen for a point-and-click style inv.

  • Player clicks on objects:
  • Left click to examine - Popup window with flavor text?
  • Right click to interact
    • Bed - Hide under
    • Door - Open (if player has key)
    • Cupboard - Hide inside
    • Collectable - collect

The game draws only the room you are in and outlines of rooms you have been to previously.
Enemy is only drawn when it is in the same room as you, outwise the only way to know how far they are is to listen for their movement to know when they are getting close, and possibly about to enter your room.

AI is to wander from room to room at random, but performing actions that make noise (Moving faster, interacting with objects) while the enemy is in a neighbouring room may attract them to investigate.

oh no… he is awake again… I must go…
…so so wingy lately.

1 Like

I’m only on story and objective? :confused: o7

I really like your working title “House of Jinn,” and the overall game idea seems right proper. However, I wonder if it will actually be fun or not – you’re basically running from room to room, randomly fast-clicking stuff to try and figure out interactions before jinni boy shows up.

Let’s prototype it. I made a CraftyJS library specifically for prototyping. I am concerned: I remember CraftyJS workflows were typically something like:

  • Get 80% of your game done in 20% of what you thought it would take
  • Get another 15% done with 50% of what you thought it would take (polishing, images, etc.)
    Spend 105% tracking down obscure or browser-specific bugs , reporting them on GitHub, and trying to make sense of what to do when the response is “you’re not using entities correctly”

We’ll see. For now, I’ll create a new repo under the MG org, copy/paste the prototyping code and sample HTML, and we can take it from there … I’ll create a WBS in an issue.

Sound good?

BTW, CraftyJS is far, far superior as far as ODroid C2 goes, compared to Pyglet.

  • Pyglet detected my controller but no arrows/thumbsticks/buttons work
  • Audio segfaults within ~15 bullet shots

CraftyJS worked like a charm out-of-the-box with F310 and audio has no issues.

Just sayin’. Full-screen support is very important to me (the CraftyJS asteroids demo does it) as is F310 support, but I can patch those in after the game inshaAllah if that’s a problem for our very late schedule (Jan 21-22 already, we have barely a month if you look at your vacation.)


I’ve created the repo here. It has full-screen support, and gamepad support, out of the box. Sorry if you don’t like it. It also expects an external.json file, like our old config.json file, except you can override parameters on the URL (more on that later inshaAllah).

MVP WBS will show up here.

Also forgot to mention: while I don’t like anti-heros, I like the idea of cognitive dissonance. In this context, the player can be doing seemingly “good” actions after memory loss; as they recover more and more journals, they discover what a vicious, cruel, and evil person they were.

Also, I like the idea of tentative quests/goals/levels/something with “one journal page per whatever” as the goal. So it’s directed, eg. you have to solve seven rooms, and each gets you a journal page. What do you think?

PM hat is on and we have lift-off.

Link please? I stopped using semicolons a long time ago and haven’t gotten into anytrouble except when minifying files. In which case, just start the file with a semicolon and bam, you’re good to go.

Probably something like this: http://stackoverflow.com/questions/444080/do-you-recommend-using-semicolons-after-every-statement-in-javascript

I’m pretty sure that’s no longer an issue. I read a similar question a few months ago which didn’t state the problem of a function taking another function as an arg. The case for semicolons now isn’t as strong as it used to be.

I need to try this!

@Wulf Sorry, I’m not interested in debating it, or in derailing the PCG thread for it. We can discuss it separately. I found it confusing and hard to read, and I remember reading about some cases where interpreters get confused, and it is mostly the industry standard.

You probably have more JS experience than me anyway! I prefer CoffeeScript, which hides you from some of the common gotchas of JS, plus has a nice, Ruby/Python like syntax.

@Severok I did some brainstorming. Based on real (and perceived) jinn stories that I know from reliable sources, I came up with a few general plot ideas (below). I would also like my 8yo to play this, and I’m not sure how to make it “kid-friendly,” but I guess he won’t read most of the story anyway.

  1. The player IS the murdering psychopath who killed his family etc. It started out with the jinn approaching him and saying “I’m enslaved since the time of Sulaymaan (alayhi salaam) (which is not true), I can do good” and ended with him committing atrocities and murder and becoming enslaved to the jinn.

  2. The manor used to be the estate of a magician/satanist/hindu/polytheist (insert religion of choice), and hence was very “jinn friendly.” It attracted a particularly nasty passer-by, who happens to haunt it and cause harm to those who enter (much like the jinns who pose as ghosts). It probably coshed our player over the head with a rather blunt object (like a big piece of furniture), causing amnesia.

  3. The house had Muslim jinns in it. One day, the owner was throwing out boiling water or something ridiculous; didn’t say “bismillah” (hadith: it creates a veil between you and them) and ended up scalding the jinn’s kid. Hence, the mom got extremely angry and possessed the manor owner (out of rage). I think he’s dead now.

  4. A world-famous shaykh used to teach here. His students came from every part of the earth; he didn’t realize, but he had jinn students, too. After his death, they considered his manor something of a sacred property, and forbid people from staying there. (If anyone ever sleeps inside, they wake up the next morning outside). And there’s a room that’s locked, and even with the key, the door is stuck, it just won’t open …

Sorry if these are all murder-mystery type things. I wrote “house” and then wrote “manor” and it makes me think of Sleuth, an excellent DOS detective game (which I tried to remake twice).

That’s all I have right now. Is one of these (or a blend, or something else) acceptable or shall I continue to brainstorm?


@AbrarSyed as discussed, inshaAllah I will ping you with a small task per week – probably once the initial prototyping is done (by Severok) and we know what we’re doing.


Check my branch. I added a simple four-wall mansion that you start in.

Try running the game, then append ?wall_thickness=32 to the URL and see what happens. This is the new config.json (see external.json).

Assalaamu 'alikum dear team lead,

I hope the hammer fell and you are well, and you will rise from the ashes inshaAllah (pun not intended).

I found myself mentally blocked room generation (knowing you would rip out my code later) so instead I moved forward: you now get a simple 2x2 room mansion. That enabled me to make doors, walls with doors in the middle, locked doors, and keys walhamdulillah.

It’s ugly, but it works: grey doors, gold locked doors, gold key. (Looks. Like. Pong.)

Keys are generic: any key for any locked door (no colour-coded keys/doors). The player also has a count of keys.

I don’t know if you know this, but you can use Developer Tools/Console (CTRL+SHIFT+E I think in Chrome) and … do awesome stuff. Like:

  • `Crafty(“Player”) // get the player object
  • Crafty.e("Door").lock() // create a locked door
  • And so on

I used this to create a second door and make sure the keys depleted correctly.

Standing by for orders – I will continue work on the WBS inshaAllah in your absence. I also really hope you can leverage my WallWithDoor entity to quickly assemble a working mansion.

Cool stuff.

Sorry again for my lack of activity. It feels like days since I have been able to sit at my laptop.

Insha Allah I can upload some code soon as I am quite frankly getting quiet embarrased by my lack of contribution lately.

Indeed I am slowly working on room generation. I will grab your code so I can see how you are handling the drawing, ect to Insha Allah intergrate my code with yours. Your walls and doors look cool. If I can define a room in terms of Width/Height, possibly with a datum (X-Y point of origin) then Insha Allah it will integrate fairly easily with what I am planning.
I would like to have the current room in the center of the screen with an outline of the neighbouring room attached to each door.

For the sake of making a feeling of claustrophobia and suspense, I would like to only render the contents of the current room so the player is never sure what might be in the next room over until they move there.

What I am working on is tree based layout generation.
I have an object class describing the definition of a room and subclasses for room types.
Room types describe dimension and what rooms can be connected to it as a child.

EG:

  • Enterance connects with: Hallway, Living room, Office
  • Large bedroom connects with: Bathroom
  • Small bedroom connects with: NULL.

There are 3 data sets used in generation.

  • A tree containing the generated rooms and how they connect
  • An array of objects outlining potential room placement objects and what rooms are currently valid to place there
  • An array of objects that act as a manifest for what rooms are to be placed in this area.

On start of the function, the function loads a manifest of rooms in the area being generated (An array of room types and number of each room to be placed).

The Root node (An enterance room) is added to the tree, the X-Y location of this room is used to add a set of placement nodes around this first X-Y location with the valid room types to connect to the foyer (Office, Hall and Living-room currently, though these room types have no purpose other then place holders for differnt room sizes and descriptions of what objects may later be spawned inside).

While there are items remaining in tihs manifest, a placement node is selected at random and at its’ list of valid rooms is checked against the manifest array, If a match is found, the room object is spawned as a child node to the room that spawned this placement node. (The room tree can be briefly scanned here to find a room with a neighbouring x-y location capable of connecting to this room type to add extra connections for interconnecting rooms).

As the room is placed, The placement node array is scanned for the neighbouring X-Y positions, if a match is found the allowable connecting room types are added to the node, otherwise a new node is added to this list containing only the allowable connecting room for this type.

The process is repeating until the manifest is exhausted, leaving a tree of room objects to be used for mapping the room layout of the game map.

What I am imagining for this in terms of gameplay…
I would like it if only the room currently occupied by the play is rendered, leaving the player to work of auditory clues for where the enemy is.

  • The Enemy AI is to constantly be hunting for the player, randomly moving form location to location
  • The player can not see where they are, but they hear movement each time the enemy moves with volume depending on how many rooms away they currently are.
  • When the Enemy reaches a closed door, they have a chance of attempting to open it and a subsequent chance of succeess. On this event they generate a sound of bashing on the door
  • When the player moves or interacts with an object, they have a chance of drawing the attention of the enemy depending on how many rooms away they are

Gameplay sort of like the old text room-based games where the player will be hunted moving from room to room as they are given written clues about which room the monster is currently in. Replacing the text with a mixture of 2D visuals and sounds.

IE:

  • the player is walking around a room examining objects for information.
  • They hear the sound of footsteps grow larger than fade, a bashing sound can be heard on a far away door.
  • The player decides to risk moving to the next room, they open the door and slip into the connecting hallway.
  • Footsteps grow louder so the player opens the next door and rushes inside. Footsteps grow louder but stop.
  • Player runs over to a cupboard and interacts with it to hide,
  • A loud bashing sound occurs and the door opens, the jinn stepping inside.
  • Player remains motionless not agroing the jinn further until it selects a new location and leaves. (Unless they are unlucky and the AI decides to inspect some of the room objects closer.)

In doing this Map_gen function I have learned a heap about the JS array functions like .some() .find() .forEach(), ect. So that is pretty cool. I am no longer using:

 For(index=0, index<array.length, index++){ if (condition==true){Do stuff; break;}

instead now:

Array.forEach(Dostuff());

or

if(node.find(XYmatch())!=undefined){ Node.attribute = stuff}

Don’t worry about your commitment. We have an understanding of sorts. Whatever we can contribute, we’ll go with.

Your generation algorithm sounds complicated. I try to write simpler code, maybe that’s why; but, I can see the strength of it (generating connecting rooms, etc.) – it sounds good. The only real hurdle I see is understanding how to draw a gap between walls/rooms to connect them.

Maybe we can draw every wall as two parts (doorway in the middle), and just fill in unneeded doorways later. That’s easier.

Let’s keep plugging away at this. Please merge my/your changes to master occasionally as things look good. Next, I’ll try to work out how to make only the current room lit.

In my previous code I had rendered each set of terrain tiles as a room which reloaded (Resetting the tile attributes/colours) and shifting location to the otherside of the room when the area transition is reached.

I saw this as a better use of resources, scanning though and changing the colour/attached typeID of each tile instead of purging the whole array and spawning a new set of objects.

Perhaps we can do this again by drawing 1 room as per the attributes of the currently referenced room ID, on reaching an open door and triggering a new area transition, the ID on the room connected to that transition is used to read attibutes from the new room ID.

  • Read room Width,Height and resize existing walls.
  • Remove old doors and place new doors for this rooms links
  • Shift player X or Y location to place them on the opposite side of the room where they will be entering from
  • Scan though the list of furniture for this room object and spawn the needed objects.

We just then need to check the room dimensions and locations of the connecting rooms and do something like spawn some large dark squares of the correct dimension/positions to give the player an indication of what is conncting to the current room

I think they beauty of using a room manifest like this is that in theory you can run the process multiple times to generate multiple room trees which you can then connect together creating 1 large map with discreet locations, IE The player starts in a location with 10 bedrooms, 3 bedrooms, 2 studies and some connecting hallways , as they explore out and reach a new area they might start seeing clusters of offices and rec-rooms as they have moved into a new room-tree that was generated from a different manifest.

This would let us devide the location into several areas/wings instead of having an unstructured random mix of rooms throughout.

Game progression can be built off this like:

  • Player starts in sleeping quarters in an area populated mostly by bedrooms, bathrooms & occasional studies. Door for area transition to next room-tree is locked with the key being spawned in a study the player needs to find.
  • Player finds key and transitions to new area containing recreation + living spaces, progression is blocked by (Item based puzzle)
  • Player reaches new room-tree consisting of offices, hallways and the foyer. The building is locked down by a mechanical lock and the player needs to head to the basement to restart the generator.
  • Ect.

Transitions between room-trees could be the hook where we insert road blocks, reaching a new tree could be the event where we add an extra challenge like adding a new enemy to the mix.

In general, performance is not a problem until we can see the problem. I wouldn’t worry about reusing existing tiles; that might introduce bugs (eg. state of the doors doesn’t reset).

Instead, I would lean heavily on the side of code that’s more understandable and “straight-forward” like deleting and recreating the objects. The performance hit will be negligible, and if there’s anything I learned from Dajjal’s Minions, it’s that clever code produces clever bugs that require clever fixes… I like easy fixes.

Defining a room as tiles isn’t enough, because we need walls and doors. I’m going to create a “room” object inshaAllah with three walls, and one side having an opening (or door, or locked door). That way, you can just say “give me a room at (x, y) with the opening pointing in direction z” and poof, instant room.

For fog of war, I have some interesting ideas that may produce, well, interesting effects. I’ll prototype it today inshaAllah if/when I get rooms working as an entity.


Signing out. I pushed room generation. The API is pretty readable IMO and easy to use. Excerpt from index.html:

Crafty.e("Room").create(0, 0, houseWidth / 2, houseHeight / 2).seal("nw").door("s").lock("s"); // top-left 

This creates a room that has the top and right sealed (continuous walls) and a door on the left side that’s locked. If I change .door("s") to .door("se"), I get an additional door on the RHS that’s not locked.

Salams,

Room lighting is good to go. Notice there’s a spot in the middle where it gets fully dark.

2 Likes

I think this project is at risk.

@Severok could you please do two things for me?

  • Commit code often. As soon as you have a small change tested and working, commit it.
  • Push code. Even if it’s once a day (more frequent is better).

Right now, our two code branches are diverging, and we’ll have a nasty time trying to reconsolidate. If you can push often, I can at least update mine to merge in your changes.

I also need confirmation on which of these four story stubs you want me to pursue.

That lighting looks amazing. Masha’Allah
Very nice work.

Unfortunately I feel like I am doing nothing but appologising for my lack of contribution lately.
This past week is better left unspoken of, but Alhamdulillah everything seems to be resolved nicely and I am good to go again. On the plus side I learned some new SQL tricks in the process, so I have that going for me.

I am ready to start integrating my map generator into your code as I had done with my Island map generator some time ago.

It is still very rudamentry, I have greatly simplified the generation process I descriped in my previous comment,
I have not yet added the manifest as I had originally planned, but Insha Allah it can be added later if there is time. For now the map is generated is no limit to any specific room type spawning. The only rule is that certain rooms can only be spawned attached to other rooms, that each room can only carry so many connections (As specified by room type) and the generator ceases processing additional nodes for room spawning after it reaches 100.

Here are some visualisations of the generated nodes and how they are linked.
Yellow: House enterance (Goal)
Gray: Hallway
Dark green: Room (Various including Livingroom, kitchen, bedroom, bathroom, study, etc, all definied in subclasses).
Light green: Connection between nodes.

The generator is running reliably, spitting out unique layouts every time.
Unlike my Island generator, this code generates the map almost instantly.

The resulting data is in the form of an array of objects, Each containing an ID code, ID codes for their connecting neighbour in each direction and reference to the room type. In future development I plan to add room furniture spawning to each subclass to populate a list of objects in each room to fill the house with various contents.

I am thinking that when I am parsing the room-objects array, I should check the connecting nodes to see if they are of the same type, then simply not placing a wall between them if they match.
That way hallways are continious in what ever way they run and larger rooms such as Living rooms which may spread across several nodes are drawn as larger and possibly non-rectangular rooms.

Edit: I can’t push my branch, need permission granted for this repo.
Ashes halp?

1 Like

There’s nothing to apologise for. Life happens (it happens to me too). For Deen Games, I always look for collaborators who are self-motivated to work, no matter what happens to them. Because we all have busy lives (school, work, friends, wife/kids, hobbies, gaming, etc.)

I don’t know if it’s just the colour scheme you chose, but it makes me think of a jungle, thick with vines and foliage, our hero unable to see his way forward …

The wall thing might not be as hard as you think. Currently, a room is just “four walls-with-doorways in a certain area.” You can probably grab a wall and destroy it.

Your previous generation had for-loops within for-loops within for-loops, which means LOTS of crunching/computation. That’s why it took a long time.

I’m curious to see if it lags when the player moves. The lighting check is very naive; when a player moves, it loops through all the rooms and stops when it finds the first room to light. In runtime complexity, it’s O(n) and n/2 iterations on average.

(That’s something we learned in comp-sci. O(n) means it looks through everything – n items – some number of times, eg. it does n operations, n/2 operations, 5n operations, …)

Looks great, I hope you can push it to the repo soon so I can pull/merge and get a look for myself.

Yep, that is why I went with a linked-list rather than a large 2D array like last time.

Looking at how the code integrates, it might be an idea for me to alter the room object.
Currently it has 4 attributes that define who it is connected to to the north, south, east and west respectively.
room.N .S .E .W the code would look cleaner if that were instead an array I could step though while deciding where to place the walls/doors.

I pulled your branch and merged before creating a new branch for myself.
Ultimately using your code in its’ current state as my starting point.
I have since added 2 new files. One containing the higher-level map-gen code and the other defining my room objects, specific room object subclasses and related functions for placing and connecting them.

Currently I am adding code to call my higher level code from your main code in index.html and parse the resulting file using your room objects. Currently running my branch will just give a white screen, but Insha Allah I will have that resolved before the end of tomorrow.

I have started writing the code in the main start function to step though my generated room-list to spawn your room objects in their designated locations. The X,Y attributes relating to their spacial location and the link IDs determining if a Wall, Door or open space should be used on each side.

Originally I had intended to have various room sizes, but decided it would be simplier if I had every room a constant size and just allowed certain rooms to extend their sizes by spawning child nodes of the same type in neighbouring locations. Due to this it now spawns large hallways that can wrap around corners and open into wide halls. Living rooms that don’t have to be a static rectangle shape, etc.

That visualisation code has all been removed in merging everything into your code.
Though for the life of me I can not find where you defined the room dimensions.

I am trying to commit the code as is in my branch so you can have a look at what I have done and slap me across the head as needed.

Though:
remote: Permission to MuslimGamer/house-of-jinn.git denied to severokST.
fatal: unable to access ‘https://github.com/MuslimGamer/house-of-jinn.git/’: The requested URL returned error: 403

Sorry, I didn’t realize it added the MG team as “read only” access. I switched it to Admin a second ago and you should have access to push/branch/etc. now.

I didn’t define the room dimensions anywhere. create takes in the x, y, width, and height of a room. That’s why the first call in my branch is Crafty.e("Room").create(0,0, houseWidth / 2, houseHeight / 2) – it creates a room at (0, 0) that’s 512x288. I look forward to being able to pull your code.

Meanwhile, I’ll work on creating a randomly-wandering jinn that kills you on contact. I’m almost tempted to use the Big Boo sprite for him :slight_smile:

My branch has been pushed as is.


Originally I had plans for 4 jinn based loosely on some of my favorite SCP and some horror games.
I am a huge fan of surreal horror, be it Lovecraft, Poe, various SCP or various other sources.

If you haven’t played it yet I would very highly recommend downloading and playing “SCP Containment breach” which is amongst my all time favorite free indi-games and a major source of inspiration for various ideas.

The main Jinn who pursues you from the start of the game, just being a generic AI, Idea loosely based off the Scissor man from the Clock-tower game from the SNES era that originally inspired me for this specific project

This being a character that would hunt the player while they search around the enviroment looking for items to collect to solve item-based puzzels and places to hide. In the event the Jinn lured into a room with the player, depending on how agro’d they are, they will either leave if the player is hidden or search the room, possibly giving up after checking an object or 2 to find the player depending on how certain they are of the players position.

I was thinking of the game being dark with the player having a flashlight that would light up the room in a cone in the direction the player is facing, with the option of hitting a lightswitch on the wall to light the whole room.


As the player opens up new areas, I was thinking of adding additional Jinn with differnt AI such as:

Dark hunter -
Based loosely on SCP-173 which later inspired the ‘Weeping angels’ from Dr Who.

http://www.scp-wiki.net/scp-173

https://creepypastapeeps.files.wordpress.com/2013/12/scp___173_by_nexnirvos-d6jisbo.jpg?w=350&h=237

In Game:
Highly agressive, significantly faster than player.
Completly freezes in light or when viewed by the player.
During an encounter, the player must either activate a light or keep the mouse cursor over this jinn as they move to keep it still. Shifting the cursor away to interact with a door or lightswich will allow the jinn to rush towards they player if they are not quick enough.

Light-Hunter - Shy
Based loosely of SCP-096 “The Shy Guy”. Likely source of inspiration for the Minecraft Enderman being agro’d on player focus (Along with Slenderman)
http://www.scp-wiki.net/scp-096
https://s-media-cache-ak0.pinimg.com/736x/f2/3d/45/f23d4534a7dd1ee0db88118d46f9551c.jpg

In game:
The Opposite of the Dark-Hunter. This Jinn is completely passive unless exposed to light. If the player enters a room with this Jinn and turns on the light or looks at it (Shining the players torch) for longer than 2 seconds the Jinn becomes highly aggressive and fast as the dark hunter. The difference being that once agro’d, removing the light will not calm this Jinn and the player has only a slim hope of running.

Wall-Hunter
Loosely based on SCP-106, "The old man"
Can move though solid materials, occupies a pocket dimension using any flat wall as a doorway to enter our world. Captures its’ prey dragging them into its’ pocket dimension to hunt and consume.

http://www.scp-wiki.net/scp-106
https://i.ytimg.com/vi/cxvCQwX4v94/hqdefault.jpg

In game:
Highly aggressive, but slow moving. Does not wander the map, but instead will emerge out of a random wall in the players room if they remain in the same location for too long.


In terms of story, I was thinking that if we go the route with various jinns being added as the player progresses, we could maybe set the game in a former orphanage.

  • Quran has lots of references to the treatment of orphans, so we have our Islamic hook along with Jinn
  • Children had been treated unfairly by the administrators of this facility, their unhappiness had attracted the Jinn who gained strength here
  • Orphanage is now abandoned (Maybe repurposed and sold to the protagonist?)
  • Jinn carry an imprint of the personailities of various children who lived there, Progressing though the building the player finds journal entries and case reports of 4 key children who are prototypes of the Jinn encountered.

Thanks for pushing your branch. I’ve pushed to my branch with the generic jinn moving around.

Download SCP Containment Breach now.

Reading your post at 11:30 at night with the lights of was NOT a good idea and gave me a major case of the creeps.

Bad treatment treatment of children won’t attract jinns, but maybe someone using magic might. In the orphanage. Also, the major issue I see is that jinns don’t kill people (normally) – only in cases of possession where someone tries to do ruqya and is threatened that the jinn will kill the possessed person.

Maybe the four jinns are really four possessed children.

I need to play something with sunshine and rainbows right now.

1 Like

Hey @severok if I may propose, some changes to your code please please please please?

  1. Please use more white-space, especially when you have arithmetic operators, brackets, etc. It really helps with readability.
  2. Both of us defined a “room” class. This, could be a problem.
  3. The “prototype” folder is for generally-reusable prototype code I’ve used across multiple games. I think `mapbelongs somewhere else; do you agree? Could you move it?
  4. Your code doesn’t compile (I get a JS error). And it makes my head hurt. I can’t understand this:
if(map.locations[map.locations[roomdraw].N].Type!=map.locations[roomdraw].Type]){newroom.door("n");}

I understand now that map has an array of locations, and that roomdraw is an integer referring to the current room in the iteration. But I can’t understand what map.locations[map.locations[roomdraw].N].Type could mean.

This is a great case where you can use variables to add tons of readability, and you can tweak your variable names to promote understanding. I would change roomdraw to currentRoomIndex and map.locations[currentRoomIndex] to currentRoom. That would help.

I can’t decipher how to make this compile, so I’ll wait it out, and see if I can add a journal-page entity next.