Author Topic: Bases and NPC crafting  (Read 5309 times)

Offline Theundyingcode

  • NPC
  • **
  • Posts: 157
  • Mutant Cyborg With a Nuclear Tank
    • View Profile
Re: Bases and NPC crafting
« Reply #15 on: September 23, 2017, 10:39:32 PM »
So, I have been extremely tired all last week and got only a couple productive hours of work in but I made some changes so I figured i'd give an update on where I am.

Constructions: (Base command is core.  sub components must be built connecting to each other/ base command)
  • "Base Command" basically a desk. creates a "base" when placed which takes over current submap. Examine to change base's rules and priorities(TODO)
  • "Computerized Base Command" place computer on control desk. will allow use of other things in future. upgrades base command
  • "Networked Base Command" will allow even more stuff in future and utilizing sub components . upgrades base command.
  • "Bulletin Board" Examine to see base rules (TODO)
  • "Electric notice board" upgrades Bulletin Board. examine to see base status and rules (TODO)
  • "Security Systems Controller" examine to control security and defense systems (TODO)
  • "Intercom System"  instruct NPCs all at once (TODO)
  • "Radio System" Communicate with outposts (not implementing for a while)

A base class successfully takes over a sub map upon initialization and removes all spawn points.  Creates a non-saved struct that tracks information such as # of guns using each ammo type and ammo amounts in the base for quick access by other things.  Method to define and mark what is and isn't in the actual base fully planned and partially written.

TODO: link construction creation to base creation.

Honestly most of the time has gone into figuring out the existing map code which suffers severely from poor documentation and is very convoluted. (at least it's very different to how I'd do it and thus hard to understand)  I should only need another block of productive programming to get a PR up with the basic base designation.

I know currently the game has the the ability to "Manage Zones" with the default hotkey 'Y' I feel like a lot of your methods could benefit from expanding this feature! Currently it only allows you to prevent Autopick up in a zone and Prevent NPC pickup. But perhaps the framework is already there for many of your ideas!

Did't actually know about that... I'm leaving the area management till later but it might be useful then.
Mars is currently the only planet populated entirely by robots. Therefore Martian invasion is the same thing as the robots taking over.

Good judgement comes from experience.
And experience?
Well, that comes from poor judgement.

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3839
    • View Profile
Re: Bases and NPC crafting
« Reply #16 on: September 24, 2017, 02:03:30 AM »
That "taking over the submap" sounds alarming, as does the information tracking struct.
Submaps are fragile and there is a lot that could go very wrong here.

PR as soon as possible, even if it doesn't work yet.

Offline Theundyingcode

  • NPC
  • **
  • Posts: 157
  • Mutant Cyborg With a Nuclear Tank
    • View Profile
Re: Bases and NPC crafting
« Reply #17 on: September 24, 2017, 03:17:33 AM »
That "taking over the submap" sounds alarming, as does the information tracking struct.
Submaps are fragile and there is a lot that could go very wrong here.

you pass it the submap during initialization so it can read the map information. Right now the only changes it makes are removing spawn points so you don't get hulks appearing INSIDE the base though I would like a custom map symbol/name in the future.

The struct itself is fine. It's a couple of unordered maps.  I'm going to link it's updates to player or NPC actions so it shouldn't cause any real overhead.

But yes, hopefully in the next day or two...
Mars is currently the only planet populated entirely by robots. Therefore Martian invasion is the same thing as the robots taking over.

Good judgement comes from experience.
And experience?
Well, that comes from poor judgement.

Offline Reaper310

  • Zombie Food
  • *
  • Posts: 13
    • View Profile
Re: Bases and NPC crafting
« Reply #18 on: September 24, 2017, 08:44:12 PM »
it would be interesting to use this to create self sustaining survivor camps that actually use have a dedicated system of survival. unlike the survival refugee center which (supposedly) keeps people fed by trading. also being able to control npc's might allow for automated survivor settlements with a farming system and rain collecting water system, that would make the game feel really alive.

Offline EpsilonShadow

  • Zombie Food
  • *
  • Posts: 25
    • View Profile
Re: Bases and NPC crafting
« Reply #19 on: September 24, 2017, 09:00:07 PM »
I really like the idea of NPCs building stuff while player is away. It'd be cool if NPCs challenge players leadership from time to time so you have to work hard to make happy and loyal settlement.

One question. How should this camp reality bubble work? Like one around a player or something simplistic?
« Last Edit: September 24, 2017, 09:01:51 PM by EpsilonShadow »

Offline Theundyingcode

  • NPC
  • **
  • Posts: 157
  • Mutant Cyborg With a Nuclear Tank
    • View Profile
Re: Bases and NPC crafting
« Reply #20 on: September 24, 2017, 10:02:19 PM »
One question. How should this camp reality bubble work? Like one around a player or something simplistic?

My plan was for something simplistic to avoid causing unnecessary lagg. I have basically pulled a bunch of information into the base class for easy reference partially as a speed increase at the cost of memory but also to simplify things for me as I'm not completely familiar with the code's structure. The side effect of doing so however, is that I have a completely separate object containing the base's stats. Thus, I can run simple use/productivity vs. time calculations and make changes accordingly upon the player's return.

Implementing reality bubbles is still far in the future though.
Mars is currently the only planet populated entirely by robots. Therefore Martian invasion is the same thing as the robots taking over.

Good judgement comes from experience.
And experience?
Well, that comes from poor judgement.

Offline Theundyingcode

  • NPC
  • **
  • Posts: 157
  • Mutant Cyborg With a Nuclear Tank
    • View Profile
Re: Bases and NPC crafting
« Reply #21 on: October 16, 2017, 09:13:51 PM »
So I got distracted by a new internship and playing the surge (defiantly have addictive personality trait) and haven't touched cdda at all for the last 2 weeks.  I feel like I promised a bunch but am not delivering...

Anyways, i'm just about to get beck to work. As i left it the actual designation of a base is almost done and should be up as a PR for review within a day or two. There is one glaring problem already which is that I thinking submap = map tile. As a result, right now it will only actually work if your base fits into a submap.  Also, I forgot about solid rock so it's breaks in basements as well. (should be easy fix)

Here's what the first PR will(should) look like:
  • Build basic command desk construction to create base. (basically a big desk)
  • Base object is created and passed reference to submap so it can see its data
    • Base object contains additional grid overlay for flags unique to base area. (same as for field, traps, etc.)
    • Finds outer wall of structure where desk is placed and follows it around marking the outline of the base. Marks first non-inside tile in case of gap in wall. (bounding issues)
    • fills in the base by marking everything inside the outline
    • Removes spawn points from submap so no hulks will spawn inside your base
  • Edit base rules (settings) by examining command desk
  • Build bulletin board next to command desk to view base information.
  • New options added to "write on object" menu allowing you to designate furniture as "yours" or "communal" (working on "NO ACCESS" for doors)
  • Upgrade command desk with computer(s) for more options like:
  • Replace bulletin board with an information screen to view more detailed info.

There are some other things I've added but not really implemented yet; base NPC is just a header file and the other base components just sit there and look pretty; PA system- summon/instruct NPCs from command instead of finding them, Coms System - Communicate with/allow for outposts, security controls- manage the currently non-existent base security/defense systems and finally, higher level Command Desks- levels up base.  I'm also planning a "Networked" upgrade which will let you "wire" your base and spread duplicates of the base components around your base.
Mars is currently the only planet populated entirely by robots. Therefore Martian invasion is the same thing as the robots taking over.

Good judgement comes from experience.
And experience?
Well, that comes from poor judgement.

Offline RipRoarinBoogerPenis

  • NPC
  • **
  • Posts: 236
    • View Profile
Re: Bases and NPC crafting
« Reply #22 on: October 18, 2017, 11:53:06 AM »
Fantastic, thrilled to see this project hasn't been forgotten!

Offline Theundyingcode

  • NPC
  • **
  • Posts: 157
  • Mutant Cyborg With a Nuclear Tank
    • View Profile
Re: Bases and NPC crafting
« Reply #23 on: October 18, 2017, 06:32:52 PM »
Fantastic, thrilled to see this project hasn't been forgotten!

No just generally slow moving and kinda in a life slump at the moment.
Mars is currently the only planet populated entirely by robots. Therefore Martian invasion is the same thing as the robots taking over.

Good judgement comes from experience.
And experience?
Well, that comes from poor judgement.

Offline Beetlecat

  • Zombie Food
  • *
  • Posts: 13
    • View Profile
Re: Bases and NPC crafting
« Reply #24 on: October 20, 2017, 07:50:14 PM »
No just generally slow moving and kinda in a life slump at the moment.

Ugh. Totally hear that -- Hang in there, etc. ( ;) ) but in the mean time, thank you for your efforts and creative input on this. Looking forward to what comes of it.

Offline AwonGardino

  • Zombie Food
  • *
  • Posts: 4
    • View Profile
Re: Bases and NPC crafting
« Reply #25 on: October 21, 2017, 02:57:22 PM »
Sounds too good to be real. Will you make also a social interaction with NPC (Daily talk, telling a stories, etc) and relationships like friendship and rivalry (without killing eachother)?
My English level - London is the capital of Great Britain.

Offline darktoes

  • Zombie Food
  • *
  • Posts: 59
    • View Profile
Re: Bases and NPC crafting
« Reply #26 on: October 22, 2017, 01:38:01 AM »
Yeah, regardless of how long we have to wait, this would be an amazing addition to the game. I can't wait to see what happens. Keep at it man (When you have the time, of course)!

Offline chronicpayne

  • Zombie Food
  • *
  • Posts: 8
    • View Profile
Re: Bases and NPC crafting
« Reply #27 on: October 22, 2017, 02:54:44 AM »
Second that, this looks fantastic, really hope everything pushes through to see the light of day!

Offline Theundyingcode

  • NPC
  • **
  • Posts: 157
  • Mutant Cyborg With a Nuclear Tank
    • View Profile
Re: Bases and NPC crafting
« Reply #28 on: October 23, 2017, 08:56:48 PM »
So my computer has crashed out... I was expecting it to happen sometime but I thought I had another couple months before it happened.

Last December, My computer got a bad virus on a trip and I absolutely needed to get a bunch of work done. With no secondary device for internet and no backup tools I ended up manually disabling/deleting  a whole bunch of stuff. I got it working and finished my work but never got around to actually fixing the computer since it worked (mostly) but it has been slowly degrading since. I guess it finally decided to call it quits.

I'm getting it back up and running but its put me behind with other stuff. I'm not giving up on this project but please don't be wanting on me. Sorry.

EDIT: I should have all of my work saved elsewhere but, I was using a Visual studio license from my old school that I am not interested in recovering so it might take some time to dig it out. (Never liked vs to many things make it too complicated to do simple things but the windows builds were for it.) I'm putting in a Linux partition and will be working from that. Worst comes to worst, redoing it is simply a matter of retyping it.
« Last Edit: October 23, 2017, 09:06:47 PM by Theundyingcode »
Mars is currently the only planet populated entirely by robots. Therefore Martian invasion is the same thing as the robots taking over.

Good judgement comes from experience.
And experience?
Well, that comes from poor judgement.

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3839
    • View Profile
Re: Bases and NPC crafting
« Reply #29 on: October 24, 2017, 04:10:02 AM »
Not PRing anything and not even having it on github is a big risk. You can lose entire project easily if you have no backup, no history, nothing. I lost many big changes to editor crashes.
PRing (with "[WiP][CR]" tags) even something that doesn't work would get you hints on how to get it to work. Trying to figure out everything by yourself will not only slow you down, it will prevent you from learning many things.