January 2017 Game Dev: 2D PCG ARPG

Salaam bro, I am back.

Your jinn designs are a bit faster paced than I had imagined, but I am seriously not complaining, they look awesome.

I will have to pull the code ASAP, have a play around and read though your work to see where I can contibue next.

How does the overall play style feel so far?
At this point do you think we would benefit from populating the house with furniture objects and working on the hide/stealth mechanic or do you feel it would be better for the moment to keep the game faster paced and work on adding locked doors + keys and giving the player the objective to escape?

Wa’alikum as-salaamu wa rahmatullah,

Sorry I didn’t check in earlier. I was actually (and still am) down with some stomach thing since yesterday night.

Other than failing to generate a useful symmetrical mansion, I committed the following bugfixes:

  • Jinns sometimes stop while straddling rooms
  • Sometimes you get a mansion of 1-15 rooms
  • Grassy areas between rooms isn’t dark
  • Rooms have partial or broken connections

The game is fast-paced, because once you’re discovered, you’re dead. That was clear from your vision, and I stuck to it. The only exception really is the jumper. We can fix this by decreasing movement speed for jinns. The overall play feels “unfair” to me – walk around dark rooms, step into the wrong one, oops I’m dead.

Project-Management wise, we need to get the MVP done ASAP – I spent far too long generating interesting jinns. Gameplay wise, with basically instadeath on discovery, we need to let the player see into darkened rooms – I don’t think audio cues are enough.

I think stealth and furniture is the way to go. By the way, we already have functionality for locks and keys – we just don’t generate any keys or locked doors. (Trick: how do you generate a locked door and make sure the player can reach the key?)

I also had an idea for a stealth mechanic: hold still for ~3 seconds and you’re hidden from jinns who aren’t already chasing you.

Could you please PM me your email address so I can invite you to Trello? Also, can you please install the Trello Scrum FireFox/Chrome extension? I’m experimenting with using Trello to generate velocity (eg. fixed date, how much can we get done?)

The way the rooms are generated are essentially a linked list, just with 4 connecting IDs rather than 2.

We could set up a simple path finding algorithm to determine the player start location and the foyer to establish which rooms are essentially upstream and downstream from eachother, assigning a score that gets higher the closer they are to the exit.it would then be a matter of assigning locked doors, maybe by considering the 2 connecting room types to decide the most logical placements and selecting a corresponding room several links upstream towards the player start to spawn the key.

The way I imagine that to go would be like
For room min score to room max score, increasing by the difference in scores / number of locked doors.
Select room with matching score, scan connecting rooms for higher score with compatible type.
If none found, pick new room
Else set room connection type as locked.
Initialise a probability scalor as some low value, step to a lower value room, increase probability scalor by 1 increment.
Test room suitablilty for key value times probability scalor against test theshold, if pass place key else continue to next room.
If no connecting rooms with lower value detected place key anyway.

This way you are garenteed to have a key placed in a random room between the player and the locked door, keys are preferred to be placed in logical rooms such as a study instead of a bathroom, players have a reason to explore dead ends as try have a higher chance of rewards given the risk of being cornered.

Setting the main for loop for the lock placement function as the minimum path distance from the player to the exit, increasing by the distance/#locks let’s the system to be easily controlled by a configuration variable and should give the player the idea they are moving in the right direction when a locked door is encountered.

One drawback of this method however is that my algorithm allows different branches to interconnect so there is no garenteed that a locked door will impeed the player as they might be able to find a way around.

Alternatively we could generate the house in parts. Generating x number of rooms = max rooms/ number of locks. Placing a lock room at the end of each part gen then restarting the function using the locked room as the new datum instead of the foyer.

Still no garentee that the locked room could not simple be walked around using another path unless you specifically that newly generated rooms can only connect to rooms generated for that part of the house. In which case bam, you now have equally distributed locked doors at several choak points throughout the house.

We can the. Use this progression to ramp difficulty, spawning a new jinn into the mix every time a door is unlocked. IE if a house has 6 locked doors, by time they reach the end they are being hunted by 7 jinn increasing tension as they go or atleast maintaining tension by counter acting the expanding play area by keeping the area/predator density reletively constant.

Ashes since you have solo’s the AI so far, how about you work on the stealth mechanics and how the AI responds to it in huñting the player.

I can focus on expanding the house generation to include the lock/key placements and generating a list of furniture objects each room should spawn.

We can later work from there to spawning furniture objects and adding interactions to enhance the stealth mechanic.

Sorry, I’m still not back to normal health-wise.

I think the key here is to prototype and figure out how to make this fun. Key/lock mechanic seems secondary IMO to that, it’s not a main major mechanic. Seven jinns is too much.

Could you please add and estimate some backlog items on Trello for what you’re working on?

Right now, the game is too intense. It’s not like your initial prototype where you see them and you can run around them; you’re literally in the dark until you walk right into them. We need to figure out if sound is enough, or if we need not-fully-dimmed rooms, or something else so that the player stands a fighting chance.

Once we do that, we need a clear challenge and objective: do you have to grab a key and run to the front door, which is the only locked door? Do you have to collect the seven journal pages chronicling the story of the owners and your own memories? Are we going to have points, discrete levels, infinite content procedurally generated, etc.?

Time is running out. CraftyJS is full of traps, so I would like to see this nailed down by the 21st at most, so we can start polishing (graphics, audio, etc.)

Right. Project manager hat is back on, bismillah. Trello now has a bunch of prioritized tasks (in order, by priority, estimated) – please take top-down from Ready and please keep the Trello board up to date. I will also assign stuff to myself and grind through whatever I can.

Let’s. Do. This.


Done for tonight; I added the “JinnStone” (see screenshot: top-left corner). If the jinn enters a darkness-only space (not a room), it goes back to “no jinns nearby.” Close approximations to fix this failed. Is this ok?

Also, added jinn traps. Jinns don’t quite always stop hunting you when trapped, nor do they resume their regular routines; I put stories In Progress for these things.

Done for today. You can deploy traps by pressing space or T; I fixed every jinn type so they all freeze completely when trapped.

Traps auto-deploy perfectly around you:

I also added an experimental feature: traps kill clones (from the splitter) and bubbles (from the bubbler). This is also without expiring the trap itself. What do you think? (There’s a config flag to turn this off.)

Next up: once un-trapped, Jinns should return to their normal duties instead of just hanging around.

Sorry for the delay, I am reviewing the changes to the code base since my last contribution. Then I want to set to having a go at tweaking the Jinn behavior.

What do you think about me adding in a new room type:

  • Prayer room: A rarely generated room Jinn will not enter. Within this room the player is invisible to Jinn causing them to lose agro allowing the player to rest and escape if they are lucky enough to find one.

I often find with horror games, there has to be a build and release of tension to keep the player engadged. If the player is constantly hounded, than that stress becomes the new normal state and they tend to overcome any sense of horror. Moments of safety in horror tend to desensitise the viewer making them more valnerable to later horrors.

For example playing Containment breach for the first time in the dark with headphones. After being chased a few times I found myself getting more used to the mechanics and audio cues reducing the amount of tension I felt. That is until I found a supply closet in which I noticed that the SCPs never seem to spawn or chase the player into. It was about that point in that playthough I almost lost my nerve as I found it exceedingly difficult to head back into the hallways wandering too far from that perception of safety.

I have pulled your latest branch and it appears not to be running for me. I have tracked the issue down to the setupWalls function called when room objets are spawned.

Disabling this function call lets the game run without doors or full walls, but it runs.

edit: Found the culprit

    this.open(openDirections);

As far as I can see, the Room class does not contain the function ‘open()’, door() and seal() on the otherhand work fine.

Edit edit:
Fixed now. I readded the ‘open’ function which destroys w1 and w2 of the room in the specifie direction.
I will wait for your confirmation of this issue actually existing in the repo rather than just being some annomoly on my local copy before I go pushing the fix.

I am currently on the ashes999 branch, is there any reason the copy of room.js I have here should be missing that?

I’m not sure it I need to reboot or if my laptop hsa fallen below the minimum requirements but the performance I am experiencing is essentially unplayable. I would estimate in the 5-10 frames/second 100/400% cpu usage

Edit: Checking ‘top’ while playing, my CPUs are around 50, 25, 12.5 and 12.5 (values/core fluctuating, but roughly adding to 100%) respectively but I still seem to be getting around 10FPS

I know that over-optomisation is the root of all evil, but maybe we need a little optomisation?
Can we do have any sort of control over threading in an engine like this?

I like the idea of a safe room. But, I think we should move away from the jinns idea. Other than “they walk through walls,” they really have nothing in common with jinns.

The Jinnstone does this. You feel the horror of “0.5 rooms away!!!” and the relative safety of “3 rooms away.”

This is a serious problem. If you check out only my branch, it should work perfectly. Is that the case, or did you merge my branch into your branch?

This appears quite anomolous. Please try the following workflow:

  • Check out the repo to a new directory
  • Run git fetch then git checkout -b ashes999
  • Run git pull just to be sure
  • Run index.html

It should run fine.

I feared this.

There are several places where we use EnterFrame functions, which trigger once per frame per object. This is a Bad Thing. Some include expensive distance calculations, which I tried to short-curcuit.

We have to investigate further. I need this game to work on my ODroid-C2 home-made console too.

Could you try commenting out stuff in blah.bind("EnterFrame", function() { ... }) and re-running, measuring FPS, and seeing who the biggest offender is?

Salams.

Today, I wrapped up “trapped jinns return to normal after being trapped,” and I fixed the most glaring performance error. Please pull the profiling branch and try it for yourself.

If none of my above suggestions work, the de-facto way to fix this is to run a Javascript profiler. Chrome has one built in (Ctrl+Shift+I for developer tools, click Profiles, click the record button, then click stop when you’ve played that area that you want to profile.)

The most glaring performance problem was huntPlayer, which recalculated velocity every frame; I made it recalculate every 0.1s. To get my changes, fetch and pull the profiling branch.

Salaam,

Performance issue appears to be related to my instance of firefox.
Running the code in Chromium with developer tools runs smoothly.
Suggest using Chromium for your odroid.

I also wanted to ask if you would consider publishing an image of your odroid partition containing the games we write? I have been very strongly considering making my Odroid into a handheld console and would love to have some of our own work featurered in it.

Please forgive my comming rambling, I am writing notes here live as I play with the code.

  • Seriously I with I knew about the developer tools under chromium at the start of this project as it would have made debugging everything so much easier


  • I added floor colour coding for each room type and it has highlighted for me a change that I will need to make to the map generation. For starters I am currently exploring a house with 1 bedroom and 5 kitchens.

@ashes987 if you pull my branch, don’t worry too much about the colour selections. they are just so I can see how different types of rooms are connecting, I understand what each colour means and they will ultimately be removed and replaced with relevent furnishings.

After finding a bedroom that stretched for 30 room-tiles snaking around like intestines, the possible number of connections for a room is no longer equal to the maximum possible number of connections, instead now it is a random number between 1 and the maximum allowed connections for that roomtype.

This means that when a bedroom type is generated, it has the possibility of connecting to a subsequent bedroom tile or not. The probability that the bedroom or subsequent connected bedroom tile only has its’ parent connection inhibits these run-away rooms from spawning.

  • Rebalancing the configurations for new-room type selection and things are starting to look a little more sane now.

Maybe I should go back to my original idea of using a manifest to balance the room types.
IE, Spawning room, are there any allowalble connected types remaining in the manifest? if yes, select one and spawn (Decrease count in maifest and remove if empty), else move on.

Either that or I place a counter for each room type and use that to offset the probability of each room type spawning. IE aim for a 2:1 ratio of bedrooms to bathrooms, etc.

  • Still not sure why I am spawning so many dining rooms. I have set that bedrooms should be twice as likely to spawn from a hallway than a dining room, yet I have 1 bedroom here and 5 dining rooms.

  • I never see a Study being spawned either, but it should be as likely as a bedroom spawning.

  • New room type selection appears to be heavily biased to rooms specified at the start of the list. IE dining room listed once near start of list, bedrom listed twice later and study listed twice at the end. Should trend to spawn rooms in a 1:2:2 ratio respectively, however I am regularly seeing 5:1:0

  • Idea to implement tomorrow: Every room object has a list of room types that can connect to it. Treat this as a mini-manifest and purge elements from it as they are spawned. IE a dining room can connect to 1 kitchen, on spawning the kitchen is removed from the allowable lists preventing multiple kitchens from spawning attached to a single dining room.

  • @ashes987 how would you feel about making the jinnstone key-activated instead of continious and having a short charge time on key press where the player is valnerable before the information is shown?

Edit: I found why room type selection was biased to objects early in the list. There is a redundant statement in selecting the room type.

            var roomTypeSelect = randomBetween(0, currentRoom.connectionType.length);
            var roomType = currentRoom.connectionType[randomBetween(0, roomTypeSelect)];

This is selecting a number 0- # of avaliable options. The following statement selects a number of 0-previously selected number. This means that room types further down in the list have to survive 2 random selections while the objects at the start of the list have a free pass though the 1st random selection.

roomTypeSelect should have been the index used rather than a boundry condition for the following index selection.

Has now been corrected.

Edit: My favorite jinn so far is the standard walker, sped up to 200.

Wa’alikum as-salaam,

This is what I was afraid of. This is why I despise and eschew CraftyJS. Opening a bug will result in “well give us a minimal game with the problem” and it’ll go in circles 
 bottom line, I can’t expect it to work for anyone with Firefox. I just lost a huge chunk of my target players. This is bad.

I don’t have an image. I just have a tiny Python launcher here. I manually cloned and built Dajjal’s Minions from here (my fork has some social media buttons and controller support). Read the caveats (they’re important): Logitech F310 support works, nothing else. You will probably have to open a PR if you want to add support for another controller.

I am sorry. I did not train you enough, nor can I properly anticipate the mindset of a civil engineer. I was right about one thing, at least: you are able to learn and adapt fast. Faster than I predicted. So you’re able to figure things out.

I thought of doing this too, but never got around to it.

PM hat says: w[quote=“Severok, post:73, topic:290”]
@ashes987 how would you feel about making the jinnstone key-activated instead of continious and having a short charge time on key press where the player is valnerable before the information is shown?
[/quote]

e don’t have time to rewrite the room generation. We haven’t even begun on images and audio. We still haven’t even prototyped all the gameplay features. We’re at risk.

PM hat says: the Trello backlog board is supposed to be a prioritized list of ideas and things to do. Does this really take priority over the rest? If not, we’re going to lose time on non-essential features.

As a game design, I don’t like this. Without the jinnstone, you can’t see the enemy; you can’t hear them; you can only guess where they are. If you’re wrong, instadeath. It makes the game feel unfair: your only chance at survival is to hope there are some empty rooms around the jinn so you can guess where he is before he kills you.

With the jinnstone, the game becomes actually beatable: you can make pretty good educated guesses about where not to go, and survive.

I read that code at least 4-5 times and still didn’t (and still don’t) understand it. I hope this is an important lesson to both of us about how important code readability is. Sorry, I broke it.

Can we drastically cut scope to get this done? Can we reform this idea into something simpler?

How about procedural rescue missions – each level has some number of orphans to grab (to rescue) and get out (without dying). As you go up, more orphans, and perhaps more jinns (to a limit?) and/or harder jinns.

For hiding, just one item: a cupboard (or bed, or whatever). When hidden, jinns can’t see you, period. When not hidden, you’re grue food.

Does that sound like a simple, fun, dodge-and-hide kinda game? Can we try it?

I’m going to take your silence as acceptance and move forward.

Today, I:

  • Stored the level number and generate 1 + 2n orphans on level n
  • Generate actual orphans (tall, black NPCs) who you can touch to rescue
  • Added an “orphans remaining” counter to the UI (refactored out some common code)
  • Turned one of the perimeter rooms (not the entrance) into an exit room (white background)
  • Broke the wall in the exit so you can walk out of the mansion (I need to undo this)

I started adding stairs to the exit room, but didn’t finish. Stepping on stairs will take you to the next level (if you rescued all the orphans). If you haven’t, it’ll make the orphan counter flash once or twice.

Captains log, stardate 41719.2: the player can now exit the game if they touch the stairs (big black block) in the exit room after rescuing all the orphans. Touching it while some orphans remain flashes the text in red for ~1 second:

Actually rescuing all the orphans and then touching it results in a pretty hideous You Win text (intent is to generate the next mansion):

End journal.

1 Like

TL;DR: major pivot and we can use this game to raise awareness about Islamophobia, and to make a political statement about Islamophobia. How about we turn this game into “save orphans from flaming orphanages and hey, those are islamophobe arsons who are hunting you”?


I showed this to someone yesterday and received detailed feedback about the “jinn” part. TBH, it’s not really about jinns, and provides no value to slap on the label of jinns. I agree 100% with this (which they told me).

I don’t know if you guys know about this; in the last couple of weeks, in Canada, we had a mosque attacked (“lone wolf” white male shooter) who killed 6 people and wounded 14-15 (some are still in ICU). We also had an MP (member of parliment => long story) table a motion about condemning islamophobia. TL;DR she received numerous death threats and various conversative leaders are organizing anti-Muslim protests and stuff. See pictures of one here (Masjid Toronto is one of the first in Toronto):

The CAI banner says “pedophilia”, “honour killings”, “suicide combing”, “kfair” on the visible side. This is nothing to speak of the US, where they had a major mosque arson a day after Trump signed his anti-Muslim ban. That’s just one incident.

I also recently put Deen Games on Patreon (TL;DR: raise funds monthly for development tools/costs). After spending two weeks to perfect it, I posted about it on my DG Facebook page. Despite having 70+ organic likes (with zero advertising), I didn’t get one. Single. Pledge. None. (And the cheapest kick-back is at $1.)

I think this is because DG isn’t providing real value to people. They don’t see it. Maybe this is why I feel embarrassed to tell people I know, personally, what I’m working on. I realized that I should be creating educational games, but also addressing social-good issues.

So, let’s mix all this together. We can pivot the game to be a firefighter game: you’re here to save orphanages which are mysteriously set alight. By arsonists, who happen to also be islamophobic – they’re doing it to hurt the ummah (by preying on the weak).

Gameplay-wise, sneaking, hiding, etc. still makes sense. Perhaps we will want to add a “flames” mechanic (flames block you, you can douse them – limited capacity water tank) or something.

@severok this was ultimately your idea, and if you’re not happy with this direction, we can figure out something else. I really believe we need to pivot. Please let me know ASAP.

Honestly I don’t consider this is my project anymore, least of all as I have been contributing very little in the past few weeks. If this is the direction you want to take things I am happy to support it as best I can.

Mostly I am concerned by how we might plan on incorperate story-telling into this project, particularly with the subject matter. My point of view on story telling based on real-world issues is that the themes should be subtle, inspiring the story rather than directing so that the player thinks about the story after they have finished playing it, mentally deconstructing it and then considering the issues involved.

Having the game set so that the antagonists are hate filled islamophobists burning down an occupied orphanage and otherwise straightout murdering childrenfor no reason beyond hate-filled ignorance while the brave muslim player has to step in and save the innocent children is probbably more of a sledge-hammer approach to storytelling.

I very much dislike the simple narative of ‘Muslims are victims’ and ‘Islamophobia is a mindless hatred’ as it has no benefit beyond simply telling other muslims what they already feel. Ultimately this narative seems to do more harm than good by feeding our own echo chamber, telling ourselves that we are under attack and making ourselves feel more isolated.

At the end of the day, I can not ethically can not seperate victims of these attacks. I feel equally for the muslims attacked in the mosque attacked by the alt-right as I do for the victims in Paris and the christmas truck attack in germany carried out by supporters of isis. Every time it is the exact same story, only told from a different perspective.

Regardless of their origin, Extreamist elements are a danger to everyone but even they themselves would not consider themselves to be evil, instead convincing themsleves that they are the heroes.

Might I suggest that instead we take the narative you are suggesting and invert it. For example (Tailor the example in practice to make it a little less extreme/more palitable):

  • Set the narative in a fictional location involving 2 fictional sets of people (A few added details here and there can make it obvious what the real-world inspiration is).

  • Replace the hallways of the house with streets and adjust the lighting algorithm so that our map-gen creates a village of small houses instead of a large mansion. Set the game in a civil war between 2 ethnicities or something similar. (Who these 2 groups are is upto the player, everyone will see themselves as they hero with the other faction being evil. Ultimately it does not matter if it is the alt-right attacking muslims, muslims attacking the alt-right or even muslims attacking other muslims. There is no black and white conflict and every side has innocent victims.)

  • Have the player take control of an arsonist who belives his people are being invaded/endangered setting out to take matters into his own hands. (In the players imagination they are likely a solid-snake or sam fisher type character infiltrating a terrorist stronghold)

  • Replace the jinn with the ficticious equivalent of the Muslim men trying to defend their homes/families.
    They can’t communicate with the player as they speak different languages and the player is too weak to fight directly so he has to sneak and sabatage the place.

  • As they player makes progress reaching different locations to cause damage they are given text-based developments about the damage they are doing as well as some bits and peices that humanise their targets slowly showing the previously demonised faction as being regular humans as flawed and scared as the players own people.

  • Ultimately leaving the player to realise the horrific act of evil that their previous anger has driven them to do incontrast to the heoric narative the player was fed at the start of their mission.

We have all played games where a lone player is heavily outnumbered and has to sneak into a dangerous situation to bring it down and ultimately save the world. Especially when you start by labling the enemies as terrorist we are immediately placing the player into a position they are already comfortable with,

As the player progresses however the game does not react as they expect it to, rather than reciving a sense of justice from their mission as they would otherwise get in that sort of black&white narative, they start to see the shades of grey in which they are destroying the homes of innocent people and becoming themselves what they are trying to fight

  • He who fights with monsters


If you haven’t played it, there is a fantastic scene in ‘Spec-ops the line’ that pretty much explores this narative, setting the player up in a situation where they unthinkingly cause such horror, than after the fact making them look at exactly what it is they did.

Ultimately with this subject matter you dont want the player to leave the game feeling good. Even more important than this, you don’t want to leave them feeling greater anger against the aggressors as this just feeds the cycles but instead hightened sympathy for the victims.

It is a terrible situation on all sides. You want them to start as the hero, but then start to gain empathy for the people they are being told to fight as this is what leaves them with something to think about after the game is over.

I think we disagree about how to portray the issue of Islamophobia. While it’s generally not a black-and-white issue, with recent world events, I think we’re seeing it become more of a black-and-white issue. Certainly, the frequency and magnitude of incidents is growing.

Also, we’re not making games just for Muslims. My plan with “one game a month” was to launch them on Kongregate and see how people respond. It’s not about echo-chamber; we really do need something shocking, like Rust, to help people understand our perspective.

Anyway, I think we should lay this game to rest. Sledgehammer da’wah is not terribly effective, and one lesson I learned (over and over) the hard way is “if you’re changing 50%+ of your game, it’s not the same project.”

Instead, let’s take these remaining 6-7 days in February to think and form what our next idea should be. I am again 100% for social and/or political issues. We can do something more “low-key” like poverty, homelessness, etc. if you like. Subtlety is something I need to figure out.

Let me know what you think.

P.S. please, not CraftyJS again – not for production code