Skip to content
Permalink
Browse files

Squashed commit of the following:

commit 3fbadcc
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Tue Dec 31 10:36:02 2019 +1000

    Added some more test spells. Now able to test a range of damage and heals.

commit c55c53e
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Tue Dec 31 09:30:53 2019 +1000

    Removed the source and target entity ids from all the all components and made a single component that holds them. Damage and heals and qi use now need to make sure to also get the SourceAndTarget component to know who to apply their effects onto. This will work as long as damage always applies to targets and qi use applies to the source. It breaks down in two cases: mana burn and final hit spells with damage penalties for not killing the opponent. These can be handled as special cases if they are needed, or two spells could be queued for them.

commit 0d7a62e
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Mon Dec 30 01:13:54 2019 +1000

    Spells can be cast by name now.

commit 45f3f07
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Mon Dec 30 00:53:41 2019 +1000

    Simple code to test and use prototype spells is now in place. Added concept of "re-wire" which based on knowledge of the spell type will change spell members after it has copied it to the actor register.
    Right now, it is just re-writing the source and target entities. In time it will be able to apply spell bonuses, etc.

commit 03a340f
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sun Dec 29 23:08:16 2019 +1000

    Removed the qi utilisation type as it makes no sense.

commit dbfad7f
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sun Dec 29 22:32:56 2019 +1000

    Started work on adding spells. Added a spell registry for prototypes. Defined a spell component and put a simple attribute in there to get started on testing.
    Loading and saving to XML.

commit d0df047
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sat Dec 28 19:52:17 2019 +1000

    Added one very basic hard coded spell. Any actor can cast it at any other actor. It costs qi and causes damage to the target.
    Very simple debug output of the health and qi attributes for actors.

commit e00ca09
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sat Dec 28 14:09:24 2019 +1000

    We're now destroying the entities once they are no longer needed. It's crude, because we're assuming the entity only contains that one component, but it will do for now.
    Corrected a small mistake with ticks. It's still just an approximate, but at least it will tick at constant intervals, and catch up if needed.

commit 1ea6196
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sat Dec 28 00:12:55 2019 +1000

    The ECS simulation has been moved to it's own class. It's loading test data, and saving results (though the code position for that is terrible and temporary).
    The simulation is running, but giving excessive results because the test components and entities are never being deleted.

commit 09aed03
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Dec 27 17:04:00 2019 +1000

    Added test cases. Left DamageType on the Qi component to remind me to change it to something relevant or remove it.

commit ca6a548
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Dec 27 13:13:04 2019 +1000

    Working on adding Qi as a component with a matching system. Mostly done now, just need some test cases.

commit 9d71627
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 26 05:04:41 2019 +1000

    First attempt at healing. It's just the opposite of damage for now, except there is no "type" for heals. I suspect I need to add one later - not sure if needed for now.

commit ba0b429
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 26 01:14:14 2019 +1000

    Adjusted the way DoTs are handled. It's good enough for test purposes but might be brittle for real world handling where ticks are less reliable.

commit 7ede6c1
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 26 00:11:55 2019 +1000

    Added an ApplyDamage system to take the test damage data and apply it to an entity. It worked pretty well. Only concern really is the lookup times for entities. I'm doing a brute force to get a target entity for now, but there is also a hopefully much faster lookup to get the health component for that entity. I will have to look at using an index to replace the brute force at some point.

commit 6a80c6d
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Wed Dec 25 23:21:25 2019 +1000

    Starting work on adding a Damage component to be executed at runtime.

commit 1ad8f92
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Mon Dec 23 22:17:16 2019 +1000

    Adding health and health modifier to the ECS. It's not quite right yet. Really needs a damage type for every health modifier.
    Added a first pass at the base requirements for item classes. Not sure how to make it work, looking up each one from item instances seems like it might be very slow, especially on loading.

commit 53df99e
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sat Dec 21 22:35:19 2019 +1000

    Adding an attribute template type to ease using attributes. Testing it with the Health attribute.

commit 606af71
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Dec 20 22:58:12 2019 +1000

    Removing some of the kruft from the XML file. No need for the GUIDS right now, so they are suppressed. The properties nodes are overkill. Just putting all the data into the node with the tag for that component. This will make hand editing these a lot easier.

commit 8a0e07e
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Dec 20 22:03:34 2019 +1000

    Fixed the broken code from the last check in. Components are now correctly being created and returned by reference.
    Cleaned up the code a little. Moved some code to more sensible places.

commit d7e7fdb
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Dec 20 12:52:02 2019 +1000

    Removed the template code for assigning to an entity and registry. This is no longer needed since the simpler method of having it done in the constructor is available.
    We're now ready to start putting in a bunch of components and seeing how well this thing can work.

commit 897d48b
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 19 23:24:09 2019 +1000

    EnnT test code is now working as expected. Data is being round tripped, although the order of the entities is being reversed - which will make source control of output files a little tricky.
    Started cleaning up the code, getting ready for testing by adding a slew of components.

commit 3ec7aee
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 19 22:02:32 2019 +1000

    Removing the submodule for ennt

commit aa9e3c9
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 19 21:19:45 2019 +1000

    Pushing changes prior to fiddling with the upstream master of the EnnT project.

commit 5586c96
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 19 03:02:06 2019 +1000

    Test save is operational. Still have an issue with not being able to set up the invoke as a template. Using methods on the component classes as a half measure till I can work that issue out.

commit be04af1
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Thu Dec 19 00:28:54 2019 +1000

    Testing snapshots, outputting XML, but it's not correct. Assumption about order of calls to the serial object being made was wrong. Need a way to tag each entity, and look it up each time in the XML when writing it's components. This is pretty inefficient, but it's got to be done due to the way snapshots work.

commit 7a6039c
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Wed Dec 18 22:29:14 2019 +1000

    Experimenting with the snapshot ability as a way to save instead.
    This time around I have managed to get the operators for the output archive correct, and it runs and calls them. Need to see about writing it to XML now.

commit d6d351c
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Tue Dec 17 22:39:34 2019 +1000

    Enough test code written to create a new component and add it to an entity using only hashstrings which can be read from an XML file. Everything should be in place now to make the XML loading code work.

commit a9630b7
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Tue Dec 3 21:51:34 2019 +1000

    Prototyped a lot of the XML reading code. Missing the most important part - instantiating the components.

commit 45ee8da
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Tue Dec 3 09:33:25 2019 +1000

    Minor cleanups to code. Getting prepared to re-load the XML now.

commit 48692b6
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Tue Dec 3 08:54:46 2019 +1000

    Test code is creating a decently formatted XML file and using the serialize code to populate the component properties.

commit baf003b
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Mon Dec 2 13:34:05 2019 +1000

    Successfully pulling data from the ECS and writing the basics out to an XML file. It doesn't have the ability to use the component serialise function yet. Still looking through the code for the best way to handle that.

commit 0d2f4e6
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Nov 29 22:10:27 2019 +1000

    The basic layout for a component seems to work so far. Next step, saving and loading it.

commit 4865a4d
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sun Nov 17 05:06:58 2019 +1000

    Checking in before switching branch.

commit 021e7e0
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Mon Nov 4 23:37:17 2019 +1000

    Enough code written to support output serialisation of the entities to a null device. Need to actually get it to go somewhere now it compiles.

commit cfedb62
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Sat Nov 2 21:57:34 2019 +1000

    Attempting to get some serialisation is not going well. Not sure how to make it play nice with anything, let alone YASLI.

commit d22a8a4
Author: Ivan Hawkes <ivan.hawkes@gmail.com>
Date:   Fri Nov 1 22:44:37 2019 +1000

    Added in repository for entt, theECS header only code. This needed extra include files which required a change to the makefile. That change will be lost next time it regenerates a soultion so it might be time to figure out how to prevent that happening.
    Some really dirty test code is in place to make sure the ECS works, and so far it has. Will need to allow it to serialise, which will be the next big challenge.
  • Loading branch information
ivanhawkes committed Dec 31, 2019
1 parent 0c23a40 commit 9d60e35e7cc1cd6af2227917c1be2fc7da75e03a
Showing with 3,136 additions and 225 deletions.
  1. +3 −0 .gitignore
  2. +3 −0 .gitmodules
  3. +345 −3 assets/chrysalis/levels/test_all.level.cryasset
  4. +103 −16 assets/chrysalis/levels/test_all/layers/main.lyr
  5. +1 −1 assets/chrysalis/levels/test_all/test_all.level
  6. +52 −0 assets/chrysalis/parameters/items/test-out-snapshot.xml
  7. +33 −0 assets/chrysalis/parameters/items/test.xml
  8. +60 −0 assets/chrysalis/parameters/spells/spells-snapshot.xml
  9. +68 −0 assets/chrysalis/parameters/spells/spells.xml
  10. +2 −2 bin/win_x64/Chrysalis.dll
  11. +286 −124 code/ChrysalisCore/Actor/ActorComponent.cpp
  12. +8 −2 code/ChrysalisCore/Actor/ActorComponent.h
  13. +38 −0 code/ChrysalisCore/CMakeLists.txt
  14. +2 −2 code/ChrysalisCore/Components/Door/DoorComponent.h
  15. +67 −66 code/ChrysalisCore/Components/Player/Input/PlayerInputComponent.cpp
  16. +1 −1 code/ChrysalisCore/Components/Skeleton/JointManipulationComponent.h
  17. +142 −0 code/ChrysalisCore/ECS/Components/Components.cpp
  18. +344 −0 code/ChrysalisCore/ECS/Components/Components.h
  19. +294 −0 code/ChrysalisCore/ECS/Components/Health.h
  20. +30 −0 code/ChrysalisCore/ECS/Components/Inventory.h
  21. +88 −0 code/ChrysalisCore/ECS/Components/Items.h
  22. +282 −0 code/ChrysalisCore/ECS/Components/Qi.h
  23. +26 −0 code/ChrysalisCore/ECS/Components/Spell.cpp
  24. +80 −0 code/ChrysalisCore/ECS/Components/Spell.h
  25. +10 −0 code/ChrysalisCore/ECS/ECS.cpp
  26. +12 −0 code/ChrysalisCore/ECS/ECS.h
  27. +181 −0 code/ChrysalisCore/ECS/Systems/ECSSimulation.cpp
  28. +39 −0 code/ChrysalisCore/ECS/Systems/ECSSimulation.h
  29. +8 −0 code/ChrysalisCore/ECS/Systems/ItemSystem.cpp
  30. +9 −0 code/ChrysalisCore/ECS/Systems/ItemSystem.h
  31. +281 −0 code/ChrysalisCore/ECS/Systems/Systems.cpp
  32. +26 −0 code/ChrysalisCore/ECS/Systems/Systems.h
  33. +67 −0 code/ChrysalisCore/ECS/Systems/XMLSerializer.cpp
  34. +76 −0 code/ChrysalisCore/ECS/Systems/XMLSerializer.h
  35. +12 −2 code/ChrysalisCore/Interfaces/IActor.h
  36. +8 −0 code/ChrysalisCore/Item/ItemSystem.cpp
  37. +11 −0 code/ChrysalisCore/Item/ItemSystem.h
  38. +25 −0 code/ChrysalisCore/Plugin/ChrysalisCorePlugin.cpp
  39. +12 −3 code/ChrysalisCore/Plugin/ChrysalisCorePlugin.h
  40. +1 −0 code/SDK/entt
  41. +0 −3 code/bin/win_x64/Chrysalis.dll
@@ -72,6 +72,9 @@ error*.*
log.txt
*.tmp

# Cmake keeps setting this as the folder for binaries - so this keeps them out of the repo at least.
code/bin/

# All other things.
/assets_source/
/assets/animations/editor/
@@ -0,0 +1,3 @@
[submodule "code/SDK/entt"]
path = code/SDK/entt
url = git@github.com:skypjack/entt.git

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,5 +1,5 @@
<Level WaterColor="16711680" SandboxVersion="1.0.0.0">
<View ViewerPos="65.630142,58.553413,34.215439" ViewerAngles="-0.37601966,0,0.043705173"/>
<View ViewerPos="67.183487,57.968166,34.964779" ViewerAngles="-0.43002057,0,0.46370536"/>
<Fog Fog="" Terrain="" EnvState="" VolFogShadows="" VolumetricCloud="" Ocean="" OceanAnimation="" DynTexSource=""/>
<Missions Current="Mission0">
<Mission Name="Mission0" Description="" PlayerEquipPack="" Script="" MissionTime="14:10">
@@ -0,0 +1,52 @@
<entities>
<entity>
<components>
<name CryXmlVersion="2" name="Villain" displayName="Villain"/>
<health CryXmlVersion="2">
<health base="100" baseModifiers="0" modifiers="0"/>
</health>
<qi CryXmlVersion="2">
<qi base="100" baseModifiers="0" modifiers="0"/>
</qi>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Hero" displayName="Hero"/>
<health CryXmlVersion="2">
<health base="100" baseModifiers="0" modifiers="0"/>
</health>
<qi CryXmlVersion="2">
<qi base="100" baseModifiers="0" modifiers="0"/>
</qi>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Flashlight" displayName="@Flashlight"/>
<item-class CryXmlVersion="2" maxStackSize="1" animationTag="flashlight" isUniqueInventory="true" isUniqueEquipment="true" isDroppable="true" isAutoDroppable="false" isPickable="true" isAutoPickable="true" isUsable="true" isTradable="true" isConsumable="false"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Villain_xxx" displayName="Villain_xxx"/>
<health CryXmlVersion="2">
<health base="200" baseModifiers="0" modifiers="0"/>
</health>
<qi CryXmlVersion="2">
<qi base="200" baseModifiers="0" modifiers="0"/>
</qi>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Hero_xxx" displayName="Hero_xxx"/>
<health CryXmlVersion="2">
<health base="100" baseModifiers="0" modifiers="0"/>
</health>
<qi CryXmlVersion="2">
<qi base="100" baseModifiers="0" modifiers="0"/>
</qi>
</components>
</entity>
</entities>
@@ -0,0 +1,33 @@
<entities>

<entity>
<components>
<name CryXmlVersion="2" name="Hero_xxx" displayName="Hero_xxx"/>
<health CryXmlVersion="2">
<health base="100" baseModifiers="0" modifiers="0"/>
</health>
<qi CryXmlVersion="2">
<qi base="100" baseModifiers="0" modifiers="0"/>
</qi>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Villain_xxx" displayName="Villain_xxx"/>
<health CryXmlVersion="2">
<Health base="200" baseModifiers="0" modifiers="0"/>
</health>
<qi CryXmlVersion="2">
<qi base="200" baseModifiers="0" modifiers="0"/>
</qi>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Flashlight" displayName="@Flashlight"/>
<item-class CryXmlVersion="2" maxStackSize="1" animationTag="flashlight" isUniqueInventory="true" isUniqueEquipment="true" isDroppable="true" isAutoDroppable="false" isPickable="true" isAutoPickable="true" isUsable="true" isTradable="true" isConsumable="false"/>
</components>
</entity>
</entities>
@@ -0,0 +1,60 @@
<entities>
<entity>
<components>
<name CryXmlVersion="2" name="Innervate" displayName="Innervate"/>
<utilise-qi CryXmlVersion="2" quantity="20"/>
<replenish-qi-over-time CryXmlVersion="2" quantity="4" duration="10" interval="2"/>
<spell CryXmlVersion="2" spell-rewire="regenerate" range="25"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="HealAndRenew" displayName="HealAndRenew"/>
<heal CryXmlVersion="2" quantity="12"/>
<heal-over-time CryXmlVersion="2" quantity="2" duration="10" interval="2"/>
<utilise-qi CryXmlVersion="2" quantity="12"/>
<spell CryXmlVersion="2" spell-rewire="heal" range="25"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Renew" displayName="Renew"/>
<heal-over-time CryXmlVersion="2" quantity="3" duration="10" interval="2"/>
<utilise-qi CryXmlVersion="2" quantity="8"/>
<spell CryXmlVersion="2" spell-rewire="heal" range="25"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Heal" displayName="Heal"/>
<heal CryXmlVersion="2" quantity="17"/>
<utilise-qi CryXmlVersion="2" quantity="8"/>
<spell CryXmlVersion="2" spell-rewire="heal" range="25"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Scorch" displayName="Scorch"/>
<damage CryXmlVersion="2" quantity="12" damageType="fire"/>
<damage-over-time CryXmlVersion="2" quantity="2" damageType="fire" duration="10" interval="1.5"/>
<utilise-qi CryXmlVersion="2" quantity="11"/>
<spell CryXmlVersion="2" spell-rewire="damage" range="25"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Shadow Word Pain" displayName="Shadow Word Pain"/>
<damage-over-time CryXmlVersion="2" quantity="2" damageType="unholy" duration="10" interval="1.5"/>
<utilise-qi CryXmlVersion="2" quantity="6"/>
<spell CryXmlVersion="2" spell-rewire="damage" range="25"/>
</components>
</entity>
<entity>
<components>
<name CryXmlVersion="2" name="Fireball" displayName="Fireball"/>
<damage CryXmlVersion="2" quantity="14" damageType="fire"/>
<utilise-qi CryXmlVersion="2" quantity="7"/>
<spell CryXmlVersion="2" spell-rewire="damage" range="30"/>
</components>
</entity>
</entities>
@@ -0,0 +1,68 @@
<entities>

<entity>
<components>
<name CryXmlVersion="2" name="Fireball" displayName="Fireball"/>
<spell CryXmlVersion="2" spell-rewire="damage" range="30"/>
<damage CryXmlVersion="2" quantity="14" damageType="fire"/>
<utilise-qi CryXmlVersion="2" quantity="7"/>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Shadow Word Pain" displayName="Shadow Word Pain"/>
<spell CryXmlVersion="2" spell-rewire="damage" range="25"/>
<damage-over-time CryXmlVersion="2" quantity="2" damageType="unholy" duration="10" interval="1.5"/>
<utilise-qi CryXmlVersion="2" quantity="6"/>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Scorch" displayName="Scorch"/>
<spell CryXmlVersion="2" spell-rewire="damage" range="25"/>
<damage CryXmlVersion="2" quantity="12" damageType="fire"/>
<damage-over-time CryXmlVersion="2" quantity="2" damageType="fire" duration="10" interval="1.5"/>
<utilise-qi CryXmlVersion="2" quantity="11"/>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Heal" displayName="Heal"/>
<spell CryXmlVersion="2" spell-rewire="heal" range="25"/>
<heal CryXmlVersion="2" quantity="17"/>
<utilise-qi CryXmlVersion="2" quantity="8"/>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Renew" displayName="Renew"/>
<spell CryXmlVersion="2" spell-rewire="heal" range="25"/>
<heal-over-time CryXmlVersion="2" quantity="3" duration="10" interval="2"/>
<utilise-qi CryXmlVersion="2" quantity="8"/>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="HealAndRenew" displayName="HealAndRenew"/>
<spell CryXmlVersion="2" spell-rewire="heal" range="25"/>
<heal CryXmlVersion="2" quantity="12"/>
<heal-over-time CryXmlVersion="2" quantity="2" duration="10" interval="2"/>
<utilise-qi CryXmlVersion="2" quantity="12"/>
</components>
</entity>

<entity>
<components>
<name CryXmlVersion="2" name="Innervate" displayName="Innervate"/>
<spell CryXmlVersion="2" spell-rewire="regenerate" range="25"/>
<replenish-qi-over-time CryXmlVersion="2" quantity="4" duration="10" interval="2"/>
<utilise-qi CryXmlVersion="2" quantity="20"/>
</components>
</entity>

</entities>
Git LFS file not shown

0 comments on commit 9d60e35

Please sign in to comment.
You can’t perform that action at this time.