Hi. I'm Arseniy, nice to meet you =)
Long introI'm attempting to learn to code, since it's really useful in this industry in general and me being a freelance game designer... So, I'll try to make something like this:
- A 2d top-down "GTA2-like" game.
- A small town with a police department, a hospital, a morgue (or cemetery), a couple of motels, a gun store, a casino and houses for every NPC.
- Oh, and an underground weapons dealer and a brothel. Yay!
- Town is inhabited by NPCs - everyone has a house, a job (in one of the establishments above) and basic behavior (like oh, it's late, I better go home).
- Nothing comes out of thin air except for tourists (for example money physically travels from hand to hand, or if someone dies, he stays dead).
- Tourists visit the town (cuz casino) - they stay at motels, gamble and if lucky get out of the town alive.
- The aim is to make this really small town as deep as possible, instead of making it big (for example, it'd be cool if someone gets into a hospital and his family would visit him. Stuff like that).
- I most definitely will add new "jobs" but the basic outline of the city should be like described. And the priority should be at adding depth to the existing ones.
There is stuff I'm not even going try to execute:
- Proper pathfinding.
- Improper pathfinding.
- Cars.
- Graphics.
Maybe in another life =)
For now, every structure is a colored rectangle and NPC is a circle.
I'd like to emphasize - I have no coding background, I'm not familiar with best practices or patterns or anything. So this will be my "baby talk". If I achieve desired effect - I'm happy, no matter how ugly the solution will be.
Also, it may take me A LONG LONG LOOONG time to do something trivial - I'm a noob.
And I have a day job, so I do not have much free time.
What I've done as of nowPlayer
- Can move
- Can shoot (unlimited ammo as of now)
- Has "energy" level (probably temporary)
- Has money.
- Is immortal.
Hotels (will later be used to save the game)
- Are usable by player
- Replenish energy
- Advance time by 8 hours
- Cost money to use. Hotels store money (no vanishing $$$). Can't steal it just yet =(
The idea is that it might be hard to track down player on the run (if he's not shooting in the middle of the town). But if players need to go to their "safe place" police strategy might shift from "locating the player" to "locating player's hideout". So, from "place of invincibility" it will change to "place of vulnerability".
Police department
- Spawns cops (cuz there's no "getting a job" functionality).
- Keeps track of how many of them died (currently via magic, cuz there is no proper "transferring information" functionality)
- Spawns 2 new cops for every killed cop (also temporary - cop killing will have set of consequences)
A timer.
- Keeps track of day and time.
And it barely took me 2 weeks!
What's nextBasic cop AI
- Patrol the area during the day, come to PD at night
- See player shooting a gun = try to shoot him (probably gun range will be less than cop's FOV)
- Remember player. If seen player committing crime - remember him. If see unarmed player later - try to shoot him (for now). Other cops do not have the knowledge of it happening automatically.
- If remembered player as a criminal and went back to PD, "describes" player to fellow officers in the PD. They will have a chance to recognize player as a criminal (or not)
- Has "field of view" collider - can't see stuff outside of it. Probably another collider of "awareness" (I do not want cop to stop dead if player moves behind cop's back)
- Tries to pursue player. If loses player - tries to "look around" for a while and goes back to patrolling.
- Totally inactive at night (do not see player) but wake up if being shot at
- Some placeholder behavior, when one a cop witnesses another cop being murdered by player
- Some placeholder behavior, when a cop dies without any witnesses
That could take a while =)