HTML Rough (working title)

esoom

Active Member
Sep 6, 2017
930
1,090
Updated: 16/9/2019 (Fight: Used a different way of stopping errors when searching for direction of movement, fixed wrongly skipping movement paths if there was a rotation first)

I have recently been working on a HTML game made in Twine & Sugarcube in the likeness of "Life Choices" and those Russian QSP games where you can do your own thing in a sandbox style scenario.

It currently features...

* Character creator with age & birthday, male or female, and a very basic story, (WiP)
* Random NPC generator which generates town population which auto sizes itself when required, (Completed).
* NPC family generation where children that were generated are assigned to eligible parents, (Completed).
* Shop system for wearable items, (WiP).
* Grocery shop for consumable items (food, drink), (WiP).
* Hygiene, bladder and bowel stats, if you eat and drink you need to use the toilet, which can effect clothing if you don't use the toilet, (WiP).
* Equippable items & clothing, with privacy concerns when changing, (Completed).
* Carry capacity - Clothing & consumables bought from shops will require spare carry capacity, (Completed).
* Player home, (WiP).
* NPC interactions when in public places, (WiP).
* Quest & tutorial system, (WiP).
* Tactical fight system, (WiP).
* Town(s) to walk around, (WiP).
* Date and time with schedule system, (WiP).

This is not a fully playable game yet (just the framework), any feedback would be welcome, especially reporting any bugs.

If anyone would like to use the framework I've made to make their own game you can just ask, I've attempted to make it as easy as possible to modify, most of the game variables and arrays are located in the config widget and the game uses those to generate everything. There are templates for the map locations.
 
Last edited:

esoom

Active Member
Sep 6, 2017
930
1,090
Features to be implemented...

* a system for dynamically growing over time if you start with a younger character, partly in.
* Varieties of shops and locations.
* stats for clothing that increase looks, agility, perceived age and whatnot.
* a durability system for clothing so clothing wears over time based on hours worn or other situations.
* a calendar system where you can schedule to meet people that have been previously interactions with.
* a NPC schedule system that affects where they are likely to show up and at what times.
* a system to contact previous randomly generated NPCs that are well known.
* a fast travel system which works out a route to destination and shows any applicable events on route, such as going to work and other places frequently used, again could be based on the calendar and quest system.
* a combat mechanic to fight off surprise hugging/mugging or perhaps do some hugging of your own.
* a house/shop burgling and a shoplifting mechanic, with consequences.
* Ability to buy property, possibly including shops or other establishments.
* Hire staff from the list of random NPCs that are currently unemployed, or perhaps employed but can be persuaded.
* Deal drugs.
* Kill people, why not, I've already put the knife in.
* Get arrested, possibly put in prison or some community punishment.
* Pet cats.
* Random quests from random NPCs, such as baby sitting or other agreed upon things which may or may not be perverted.
* Some visual stimulation.
 
Last edited:

esoom

Active Member
Sep 6, 2017
930
1,090
Cheers for the tips, the temp variable thing I only set with the $t_blah because I use those variables on a different passage to make an array, I wanted to set all the array vars in one go and the temp vars don't survive going to a new passage so I ended up with a massive load of stuff to unset (which is why I named them "t_"). I've not done it anywhere else just the character creation part because I really didn't want to put all of that stuff on one passage, unless there is another way...

I could use true/false where applicable I just have no idea if I will be using a third state most of the time. You can still use if and if not (!) with 0 and 1 entries anyway. I will fix it for debug and all the init stuff, I'm just lazy :).

Didn't realise story init was a thing, will look into that, I've put all the init stuff in a widget for the time being. The nobr option is something I didn't notice :).

You are right about the <<print>> thing, I just use it because it's easier to find where the printed stuff is in a huge chunk of code, I will change that where it makes sense to.

You probably would have shit yourself if you had seen the code earlier I was using <<endif>> everywhere :). I will clean it all up at some point.

Also just to ask because you seem to know a bit, is there any way to stop twine glitching when you maximise the edit window thing, on a larger passage when I click anywhere it does not seem to line up where I've clicked and edits the wrong area, super annoying because I keep accidentally deleting or overwriting stuff that I didn't mean to :(.

One thing I really want to know but I can't seem to find anywhere, is there a way of disabling the 1000 for loop limit? Also if you look at my NPC generation stuff I can't work it out but if you set it to 1000 it just crashes twine and any web browser you run it in and does not display the 1000 limit error which I know is a thing, I would really like to generate more than 1000 NPCs without going through multiple for loops, I would also like to know why it crashes twine to the point where you need to end task it :(, is it something I've done wrong or is it twine. Probably asking for too much from twine.

I will put up the source file as well, just updated the project it again to fix more mistakes and add keys for houses so you can purchase a house but you have to pick up the key at a later date then you can use the key to get in the house, and you can hand the key back to the estate agent when you want to move out (will put a moving mechanic in so you need to move items from one house to another), also opens the possibility of being locked out of your own house and copying the key to give to someone.

Should probably stop and start making the story, keep getting hung up on the mechanics.
 
Last edited:

esoom

Active Member
Sep 6, 2017
930
1,090
nice... i kinda hope this is gonna get big one day like DoL
I will try my best, I'm better at the logic side of things rather than story and I am no artist (looked at daz3d but have no idea what I'm doing with that). I'm currently fixing all the things the other person suggested, keep the suggestions coming :).

Currently trying to figure out how to make the quest system work the way I want it to, then make some sort of dynamic job system where random NPCs can give out random tasks for you to complete for money or other things. Then put a bank in so you don't have to lose all your money when you get mugged and the ability to wash your dirty clothes. Then a fight system like DoL but less annoying, I like the concept but don't like the amount of button presses. Oh and house mates.
 
  • Like
Reactions: vingogkwo

vingogkwo

Newbie
May 15, 2018
49
15
well first of all sorry for the stroke you guys gonna have after reading this, i suck in english so yeah i warned ya!
Esoom i have no idea about coding or 2D art or so, imo to develop a game is the pinnacle of skill, maybe you can find some ppl who can help you ? market this idea more mabye ? i mean the "framework" looks awesome,

Suggestion wise kinda would love to see if it goes more in to "life sim"i mean you probably know DoL right ? its awesome too my fav so far but its more a "rape evading " game then life sim so yeah,

i think this project of yours will take years BUT if you really doing this out of passion i think it will one day become one of the best.

few ideas
-pregnancy and contraceptives (condoms, pill and what else there is )

-forced sex i guess is also a thing should be in game(if you play male and you have enough strenght or so you can force them
or as a female you can be forced)

-different towns ? (you could make one town and then "copy and paste" it and just rename things and replace them for the start, later on the towns could be uniqe)

-transportation (Bus, taxis, trains, """planes""", and maybe even a car the PC can buy if he made his licens )

-Girlfriend & Boyfriend mechanic ?
-Indepth NPC Interaction(as far as i can tell your frame work would work great with this i mean you allready can meet ppl they tell you there name and so on, maybe you could become friends with every npc ? so every npc will be sorta uniqe and maybe exchange phone numbers)

-Phone/smartphone,( if you have a home or life with your family your mom &dad will probably have a home Phone, you could use, if you have the money you could buy your self a phone, or maybe beg for a phone by your parents ? maybe you could do sexting with the phone?)

-School / work life ( if lets say you make a char thats 14 you need to be in school right? and if you are n adult 18+ you dont have to have a job but that would be nice)

-Age.. (i think you should make it a bit more clear that if you choose a 12 YO char in the game that this char is not 12 the chat is 18/21+ just ROLEPLAYING as 12, maybe a little warning somewhere that everything in this game is just Roleplay)

-art & animations (i think ho have some animations and art like DoL does is perfect it gives you a idea how the situation looks and what is happening not only throu text, i think it adds the little extra)

-NPC generation( since you said you have problems with the amout of them .. maybe go for "not defined population" and every person you meet is RNG BUT if you make frends with them they will be "saved" so they can be called via phone or met to go watch a movie or something like this)

Well i think thats it, like i said sorry for my english, i also think that this i a BIG ASS project and if you are alone it will be hard, just one thing you should keep in mind is, never force your self to develop this game if one day you feel like you need a break, heck go for it, i have heared of a interesting concept of working on something like this (big projects and so on)tell your self 30(or10 or 40 or what ever) Hours/ month is the minimum amount of hours i need to work on my moddels, so thats like 1 hour every day you can split this as you want as loong as you have 30hours in one month, i think this sound good ^^

well i wish you the best of luck ! oh and maybe make a patreon and a blogspot :)

edit: oh yeah the fighting system.. this will be one hard nut to crack i thinkto "take insperation" form dol for the beginning is okay ? maybe expand it further down the road ? i mean if this game becomes somewhat realistic, why not the fighting too ? :D
 

esoom

Active Member
Sep 6, 2017
930
1,090
Yeah pretty much most of your points is what I'm going for, I do prefer the life-sim bits like you said.

The fight mechanic thing I was thinking of more if you go into bad areas late at night, why I put the time of day spawning varying amounts of NPC's in, or if you are stupid enough to go in the mens toilet late at night or something.

The NPC generation I could do in batches of 100 at a time, it needs to be 100 for the population percentages to work when I generate say 90% of the population to be white it is 90 people out of 100 rather than doing funky maths on non whole numbers. The population is also randomly spawned to locations (a second array) and kept for 30 mins in game time or area change before being reloaded.

There is one thing I possibly could do, perhaps add a last seen date to the NPC, so if too many NPCs are being reused by random chance generate more, or something like that, some of those 100 NPCs wont even show up because they are children (until they age) was thinking of meeting parents with the children with them if too young. The only thing that concerns me is how that would effect game save sizes.

Different towns will be a thing, have already named the map "map-a", could possibly randomly generate the town names as well and put a few different layouts in only accessible with a car or train with random distances between them, possibly have different NPC arrays for each town with some possibility for crossover.

Totally forgot about pregnancy, I could put that in for NPCs and MC should be easy enough like I've done with NPC child assignment set except put random chance for pregnancy at varying stages instead of child assignment then every so often update the NPC database once a day at 5am or something, then make them show up at the hospital at random chance (~9 months) from conception (yay another thing to put in :))

Relationships levels are already partly put in so that's going to be there once I finish NPC interactions, was also thinking of putting traits in like in games such as Superpowered, where you need to figure out what people like and say the right things to get them to like you, like say person likes sport or hentai or something and they dislike other things or maybe they are a psychopath that pretends to like you that will get drunk and beat you or worse, or maybe they have a chunky girl fetish (you will be able to get big if you eat too much, or force fed :), same for skinny girls) If you meet the right guy he might even show you his dungeon.

How I've set the younger age stuff is you are a run away, not sure if I want to go down the school stuff just yet, I don't find it particularly fun in games like girl-life. Maybe there's something that I could do with it to make it not tedious. I think being homeless might be funny in it's own right.

Will also put weather in the game so you need to wear different clothing, gives you some incentive to get money, and have the clothing wear over time until the point where it negatively effects your appearance and you throw it away. Or just be a dirty alcoholic/drug addicted homeless person who doesn't give a fuck.

I don't think it will take years to make, only been working on this since 2nd of June knowing nothing about Twine beforehand, the more I learn stuff the quicker I can make it. Sadly art is not my thing, I would love to have some vector type graphics to show all the different combinations of things you can wear but might have to settle to just using actual images I find on the internets
 
Last edited:
  • Like
Reactions: vingogkwo

vingogkwo

Newbie
May 15, 2018
49
15
awesome !
well maybe you could also add a start with a "healty" family lets say you choose a char that is roleplaying as a 12yo girl or boy or attack helicopter and if you do bad thinks your parents will punish you or dunno your dad becomes n alcoholic and so on what i want to say is maybe your game will be the first " life sim" done right,

about the school stuff yeah well maybe you could do it on a "free" will sorta thing like you dont need to go there everyday but you can ? i could imagen a lot of events in school like dunno you get a BF/GF excange nudes via the phone and then you brake up and *Poof* your nudes are leaked and now everyone is picking on you and so on you know ?

about the homeless part.. simple awnser from me: Awesome !

i mean your game or your project has so much potential !

well that beeing said one quastion i do still have, how do you gonna "market" this soon to be gem ? i mean i dont have any idea how such games get big xd
 

esoom

Active Member
Sep 6, 2017
930
1,090
I've just added the mobile phone + alarm clock feature to the game, it will have a battery charging mechanic (because why not). Not even remotely finished yet.

But could someone please test the alarm clock feature (start a new game, once in town click on the phone on the side bar, in there you can set the time and click set alarm (not previous), then after you can click previous.

After that if you click on the wait menu you should get the alarm at the bottom, wait or sleep with that selected. If anyone can manage to break it or attempt to I would be very grateful, you don;t want to know how much weird code went into to making that, actually go a read it because I don't even understand what I just wrote to make that work.
 
  • Like
Reactions: vingogkwo

vingogkwo

Newbie
May 15, 2018
49
15
it will have a battery charging mechanic
awesome idea ! could imagen some fun events with this like, oh snap im about to get robbed in my house> i need to call the cops> oh no battary >rip

gotta love the Idroid haha anyways i tested the alarm function, seems to work fine if you dont want to break it, the only errors i had was i put the alarm for 8AM(or any other time) went to sleep till alarm 8 AM everything fine Then i just pressed again on sleep till 8am alarm and i got woken up by"
You were disturbed!
You are woken up by a noise and see a figure of a man in front of you. "
i klicked on confront just go a black srceen, also when you repeat this couple of times the first 2 times i got the " return" option but after the 3rd time blackscreen again.


oh and maybe you could add a 24Hours clock ?
 
Last edited:

Abaddon0

Member
Dec 8, 2017
115
74
Hey,

Noticed a bug in the character creation. When you press the 'Update' for the player name, the surname changes just like when you press the Randomise 'Surname' option.

If you type over the surname, it doesn't show in the line below, but it does accept the typed name on the next screen.

Update:

When I choose the 'helped by family' option, I start out with a place but the quest says I need to find somewhere.
 
Last edited:
  • Like
Reactions: vingogkwo

HiEv

Member
Sep 1, 2017
384
778
Also just to ask because you seem to know a bit, is there any way to stop twine glitching when you maximise the edit window thing, on a larger passage when I click anywhere it does not seem to line up where I've clicked and edits the wrong area, super annoying because I keep accidentally deleting or overwriting stuff that I didn't mean to :(.
Unfortunately, that's still broken in Twine v2.3.2. Hopefully, once they finish ironing out the bugs in the engine due to switching from Node to Electron, they'll get around to fixing bugs like this one.

I've found that if you maximize the edit window, and then restore+maximize the main Twine window, then the cursor behaves properly.

That said, the text editing in Twine is atrocious. I generally only do small edits within Twine, for larger code changes I use for editing JavaScript and CSS stuff, and for the rest.

One thing I really want to know but I can't seem to find anywhere, is there a way of disabling the 1000 for loop limit? Also if you look at my NPC generation stuff I can't work it out but if you set it to 1000 it just crashes twine and any web browser you run it in and does not display the 1000 limit error which I know is a thing, I would really like to generate more than 1000 NPCs without going through multiple for loops, I would also like to know why it crashes twine to the point where you need to end task it :(, is it something I've done wrong or is it twine. Probably asking for too much from twine.
This is just a config setting of SugarCube to help prevent infinite loops. See the SugarCube documentation for the .

In fact, I'd recommend at least skimming through all of the SugarCube documentation, just so you get an idea of what all is possible with it. Also, keep in mind that it's basically just an extension of JavaScript, so any JavaScript code can be used in there as well.
 

greyelf

Well-Known Member
Nov 16, 2016
1,071
787
Also just to ask because you seem to know a bit...
I am one of the answer/solution providers on the the official Twine related or web-sites ( , the , the , or recently the ), so if you visit any of these places you will see this Alias there. HiEv is another of the answer/solution providers you will find there too.

And the above Discord server or web-sites are the ideal places to obtain answers to any problem/issue you are having with either of the Twine applications themselves or the Story Format you are using.


is there any way to stop twine glitching when you maximise the edit window thing...
If you mean the Passage Edit dialog of the Twine 2.x application, then No as I only use that application on the rare occasions when I have to answer questions about the application itself and I have never seen that behaviour.

1. Are you running the Desktop release of the application or one of the web-browser based releases (hosted or run locally)?
2. Which Operating system (brand, version, edition, 32/64bit) are you running the application on?

If using a web-browser based release:
3. which web-browser (brand, version, 32/64bit) are you using?
4. have you tried using a different web-browser?

is there a way of disabling the 1000 for loop limit?
If you are needing to loop through more than a 1000 iterations then that is likely an indication that you're doing something the wrong way.

Ideally you would create any 'random' NPC's (or any 'random' object) you need just before you actually need them, this saves on both system resources and the amount of information that needs to be contained within each Moment in the story's History system. The story's History system used your web-browser's Local Storage cache to store the data it contains, and by default web-browser's restrict that cache's maximum size to 5-10 MBs.

To design a better solution more information is needed about exactly why you are generating so many objects and about what you want to with all those objects.

I will put up the source file as well
All the Passage data of your project is contained within the story HTML file you generate, so you don't need to upload the (project) source file for others to gain access to your project's contents.
 

esoom

Active Member
Sep 6, 2017
930
1,090
Just updated it so the loop limit is not a problem, moved the NPC generation into it's own widget so you can generate 100 NPCs at a time whenever that is run.

The reason I wanted more that 1000 was because I wanted the population to be persistent, but I will make it so it generates batches of 100 whenever it needs to. Is there any way of checking how much memory an array is using? Will try to optimise it as best I can to avoid limits.

I'm using the application based version of Twine on Windows 10 64bit, every time a make a fairly big passage where you can scroll down ~2 page lengths it glitches, all the things in the editor are in the wrong positions until I press a key, sometimes when I modify passage names it glitches and completely removes the passage name entirely and refuses to let me close the edit window until I quit the program and open it again, that's not so bad though.

Had no idea there were hostable web versions might try that. Edit: Beta web version seems to work fine :) cheers.
 
Last edited:

lolguest

Member
May 4, 2017
108
203
Saw your post on Life Choices. Pretty cool project you got here. I suck at making long reviews and stuff but I can certainly leave some words for support. I really want to see this finished some day.
 
  • Like
Reactions: vingogkwo

HiEv

Member
Sep 1, 2017
384
778
Just updated it so the loop limit is not a problem, moved the NPC generation into it's own widget so you can generate 100 NPCs at a time whenever that is run.

The reason I wanted more that 1000 was because I wanted the population to be persistent, but I will make it so it generates batches of 100 whenever it needs to.
Generally speaking, I'd recommend having two types of NPCs: persisting and non-persisting NPCs.

Most NPCs the player will never encounter again, so there's no need to make them persistent. Non-persisting NPCs only need the minimum amount of information and can be deleted after the scene with them ends.

You only need to make a non-persisting NPC into a persistent NPC once the NPC interacts with the player in a way that they might remember and if they could run into that NPC again. Thus, persistent NPCs should only be created on an individual basis as needed.

Creating hundreds or thousands of persistent NPCs is a bit nuts, since at most the player would likely only remember a few dozen, and really you only need high details on less than that.

Is there any way of checking how much memory an array is using? Will try to optimise it as best I can to avoid limits.
If each NPC has the same amount of data, then you can simply calculate that by multiplying that amount by the number of NPCs. If, as is more likely, the amount of data varies, then you might want to for a variety of answers on how to find or estimate the amount of memory an object is using.

That said, the best way to optimize is to avoid storing any data you don't actually need to store, including deleting data you don't need anymore.

I'm using the application based version of Twine on Windows 10 64bit, every time a make a fairly big passage where you can scroll down ~2 page lengths it glitches, all the things in the editor are in the wrong positions until I press a key, sometimes when I modify passage names it glitches and completely removes the passage name entirely and refuses to let me close the edit window until I quit the program and open it again, that's not so bad though.
If you have really big passages, I'd recommend editing them in some other editor, as I suggested earlier. You might also want to look into using instead, which is a command line tool you can use to compile Twee text files into a Twine HTML file.

If it helps, Chapel has tools for a , and a for a default project.

Finally, I'd recommend checking out . You can find links to just about every useful Twine-related resource there.

Hope that helps! :)
 
  • Like
Reactions: vingogkwo

esoom

Active Member
Sep 6, 2017
930
1,090
Seems like a thousand NPCs only uses around 200k anyway and I assume most of that is the names which I could just make a number pointing to the array of names, not that much of a problem. The huge issue I have now is the time it takes to generate NPC's it takes 6-7 seconds per 100. :(. Probably gone a little too far with the randomness.

I would generate them one at a time, but I have no idea how to write a script to follow rules of age ranges and so on, trying to make it so the encounters are genuine with real life, or whatever you set the rules to be.

Edit: actually I'm being an idiot, I know exactly how to do it. I don't need to write them to the array at once. I could use the schedule script to ask to generate more NPCs if there are not enough to display, if there are not enough new NPCs generate more, once all 100 NPCs are created reset the arrays back to the original versions and start again to keep the ratios correct.
 
Last edited:

HiEv

Member
Sep 1, 2017
384
778
Seems like a thousand NPCs only uses around 200k anyway and I assume most of that is the names which I could just make a number pointing to the array of names, not that much of a problem.
Probably more of a problem than you think, because that number is multiplied by the number of moments recorded in the game's history. So, 10 steps into your game, that's almost 2 MB just for NPCs. 100 steps into your game and that's almost 20 MB.

Regardless, nobody is going to remember 100 NPCs, much less a thousand NPCs, so keeping track of all of them is a huge waste of time and resources. You only need to keep track of the ones who will remain relevant to the players of game.

The huge issue I have now is the time it takes to generate NPC's it takes 6-7 seconds per 100. :(. Probably gone a little too far with the randomness.
Again, you should only generate them on an as-needed basis, and delete them when you're done with them.

I would generate them one at a time, but I have no idea how to write a script to follow rules of age ranges and so on, trying to make it so the encounters are genuine with real life, or whatever you set the rules to be.
Just generate each one randomly with the expected odds, and let randomness take care of the rest. Over time it should all average out.

Edit: actually I'm being an idiot, I know exactly how to do it. I don't need to write them to the array at once. I could use the schedule script to ask to generate more NPCs if there are not enough to display, if there are not enough new NPCs generate more, once all 100 NPCs are created reset the arrays back to the original versions and start again to keep the ratios correct.
You're wasting a bunch of time worrying too much about ratios. As long as it's not too lopsided for no good reason, players won't even notice.

Nobody ever quit playing a game because the ratios of NPCs were a bit off.