Author Topic: Event Sytem  (Read 2848 times)

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Event Sytem
« on: 1 August 2013, 21:46:52 »
So now that I've dealt with some burnout, I am ready to do some more work. I am currently implementing events and it may take a while to iron out the kinks. I'd expect to spend a week on getting this up and running and working fast enough to avoid messing with the game.

This is going to take over a lot of the stuff that scenarios and shit did although those are not getting removed. There will be flags and such keeping track of what events have triggered.

This should add a lot more options to the game whether you are making a standard RTS campaign or something more like the exploratory strategy games I work on.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Event Sytem
« Reply #1 on: 2 August 2013, 05:49:22 »
Hi,
  Is this adding to the existing triggers and Lua callbacks, or a whole new system?  It seems to me you can do most of this already, by maintain your flags in Lua. Not that I know exactly what you're planning (description a bit vague so far) but extending the current TriggerManager and friends would get manu thumbs up from me.
Glest Advanced Engine - Code Monkey

Timeline | Downloads

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #2 on: 2 August 2013, 06:28:56 »
Hi,
  Is this adding to the existing triggers and Lua callbacks, or a whole new system?  It seems to me you can do most of this already, by maintain your flags in Lua. Not that I know exactly what you're planning (description a bit vague so far) but extending the current TriggerManager and friends would get manu thumbs up from me.

I don't particularly want to deal with Lua. I know some people frown on essentially using XML as a trigger system but w/e. Maybe at some point I'll learn how to LUA but not now. If you've ever played something by Paradox, I am setting up an event system that works kinda like theirs on the user end. Basically you have a set of triggers, which I will extend as I progress in other game systems. Then a chance for events to trigger. It probably covers ground the current LUA stuff already does I guess.

I guess the main thing is that its separate from scenarios. So it'll work in the base game, its hooked to faction types, without a scenario. Events have flags and stuff and if you pick one option the other event chains will not trigger and such.

silnarm

  • GAE Team
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Event Sytem
« Reply #3 on: 3 August 2013, 02:30:16 »
Nothing to frown upon, you will do it the way you want, and if it works, it's good!

This does seem to me that it would be more versatile if it was implemented with scripting, but that's just my opinion :-)
Glest Advanced Engine - Code Monkey

Timeline | Downloads

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #4 on: 3 August 2013, 10:32:34 »
Nothing to frown upon, you will do it the way you want, and if it works, it's good!

This does seem to me that it would be more versatile if it was implemented with scripting, but that's just my opinion :-)

Oh no, I am sure you are correct. But I just have 0 experience with LUA/C++ integration. I was barely able to get myself to work on the project as it is, so I just need to use the method with the list friction for me.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #5 on: 9 August 2013, 03:25:19 »
I just bought new headphones so I expect my productivity to rise massively after being headphoneless for like 11 months.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Event Sytem(Basic Functions)
« Reply #6 on: 10 August 2013, 03:48:04 »
So the basics are up and running. What you can do, the triggers you can work with. With the basic system in place it shouldn't be a whole ton of work to extend the functionality.

Initially there are only the same things as require type, like units that need certain units or buildings.

I want to add a few other things.

Rather than just a minimum I want to have a minimum and a maximum. And since I'm using vectors, you can have multiple options for each item or resource or unit or upgrade or w/e you are using.

I have item and resource requirements that are local. I want to add that for events plus local units and so forth. Also timers.

Probably a bunch of other stuff as well.

For games that use player characters there will be events tied to all those as well, and I want to add some sort of morality system that links to events as well as the rest of the game.

Basically events and upgrades and maybe buildings and units you make/decide on/use generate good and bad energy of some kind. Actually, it can probably be just a resource with a slight modification. Opposing resources I guess. Wouldn't have to be good and evil. Anyways generating one cancels out any of the other before adding to itself. You could do good and evil, or nature vs technology. W/e. I guess this isn't specific to events but I'm adding it because it will be used to trigger events as well as control tech tree progress.

Basically being evil will allow you to generate karma with evil beings/societies who will give you knowledge and items and resources and units through events. Actually, this could be fun with the new AI. AI players may align with or assist you based on Opposing Concepts.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #7 on: 10 August 2013, 18:46:09 »
Now this is what I like to happen. I appear to have got the system working with like 3 compiles and only 90 minutes of work. Firstly the new resource attribute, "polar", is ready and secondly you can now have resource requirements that don't subtract anything which is mainly for polar resources but also works with any other kind.

I implemented this under resources mainly to reduce code bloat. Saved maybe 2000-5000 lines over creating a separate system. I do have a few more things to do, mostly with the user interface. I want to separate polar resources into a different display from the resource bar since if they exist its important that players understand the difference.

Now I'm going to try and add minimum and maximum values for all the requirements. That way you can implement ranges as well as neutral options for the polar concepts.

I'm also going to try to add pop ups for events so you can tell what's going on and so that events with options will be usable.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #8 on: 11 August 2013, 20:05:37 »
Events will now pop up a dialogue box with choices and each one has a tooltip for what that choice will do. I would like to have a way to stick a larger image into the dialogue box at the top for flavor but currently it can only show a title and up to 8 choices with their associated flavor title. I am currently working to add flavor text to the tool tip and maybe some extra icons to display more info. I am working on getting it so that multiple events fire, queue up in a vector and as you handle each one the next will pop up in the event window. The game pauses while you deal with events.

Anyways I expect to have everything up and running mediumly well by Wednesday at the latest. I feel like I am finally getting to the point where I can start to focus on content and an actual release with a functioning tech tree. I can produce at least passable icons so my only real limit is object models. My blender skills are sub par because I haven't had time to practice much due to programming stuff.

I really wish I hadn't had that like 4 month period of inactivity but nothing I can do unless I wanna go on the pills. Also I had a few ideas I really liked during that break so its not a total loss.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #9 on: 25 August 2013, 01:23:52 »
Well after 175 hours of EU4 since it came out I am getting back to work. I have to get a nice large chunk of work done before the next distraction pwns me.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #10 on: 26 August 2013, 17:17:37 »
I've managed to enable several features of events. Still working out some issues. Mainly, how to target a specific unit or type of unit who meets requirements and how to separate bonuses to the sovereign vs the faction and so forth. If I can avoid having an attention attack it should be done this week.

After the long break I am trying to figure out what else I still have to finish before I focus on content. I think most of the remaining stuff involves linking data. So unit/item/upgrade requirements involving the new knowledge and character stats classes. And then enabling the spawning of randomized educated citizens that have stats and do higher level jobs. And finishing off crafting.

Then I can release a beta of the game, but not the engine in general, for testing, although I'll probably end up doing most of that myself.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #11 on: 29 August 2013, 16:12:14 »
Well, I've pretty much enabled most of the stuff for events. I guess I could chuck in a few more things to be trigger options and maybe add bonus triggers for the individual options rather than the whole event so someone who does such and such will get a bonus option, but I'm gonna try to move on to other stuff and get the thing totally working before adding extra customization.

I think I currently need to make the educated citizens generator as my first goal.

MoLAoS

  • Local Moderator
  • Ornithopter
  • ********
  • Posts: 433
    • View Profile
Re: Event Sytem
« Reply #12 on: 31 August 2013, 23:51:54 »
I had a lot of trouble getting started on this but I've finally gotten into the groove. I expect to finish character generation today or tomorrow and then move on to the final major system, crafting, although that may take all the way till next weekend.

I added a CitizenModifier class that I stuck in CreatableType so that both ItemType and UnitType can have access. Basically a Unit that can produce "educated citizens" will grab the getCitizenModifiers() function from all units in a given radius and average/combine them. It will also get the EducationLevel and Predisposition for the area.

The getCitizenModifiers function in the Unit class will grab the CitizenModifier from the UnitType it is plus the CitizenModifier from the type of every Item that building has equipped, since items can represent additional rooms and shit plus other stuff, and combine it into a single CitizenModifier which it sends to the unit trying to generate an "educated citizen."

The EducationLevel deals with education and culture based on what needs the Unit spawning the new citizen has met which will give a boost to all stats which will be modified by the CitizenModifiers it pulls from nearby units averaged out/combined. The Predisposition is drawn from the purpose of the area and mostly adds to character attributes for that purpose, so all magic related character stats or w/e.

Since the base class for "educated citizens is a special unit type with some base stats, then all the modifiers will be added up to that unit to get the final result. There will also be a random factor involved which mainly swaps some values around rather although it raises the total count of stats.

So you will have a ton of semi-randomly generated citizens and part of your job is to get them employed in the right areas and to cause your cities to generate citizens of proper stats for the Orders/Guilds/Factories and what not that that particular settlement supports.

Because you don't, for the most part, control your most powerful combat/research/production units directly your new task is to design, to the degree that you can, your settlements to produce units that support your desired strategy. Although of course you directly control your sovereign character who can do various things.

 

anything