Updates GSOC 2018 -- Light And Shadow

dacharya64

Member
Contributor
This post/thread will serve as an overview for the Light and Shadow project for Google Summer of Code 2018.

Summary: This project extends the current Light and Shadow module by adding a new mode of capture-the-flag gameplay, the goal being a playable minimum viable product (MVP) with the new game mode by the end of the summer.
Student: Devi Acharya
Mentors: @SuperSnark, @Skaldarnar, @Nihal Singh (nihal111), Scott Moses Sunarto
GitHub: https://github.com/orgs/Terasology/projects/11
Slack: @dacharya64, #light-and-shadow
Forum: This post! (https://forum.terasology.org/threads/gsoc-2018-light-and-shadow.2166/)
Blog: http://dacharya64.postach.io

Original proposal can be found here: https://drive.google.com/open?id=1jCgZtg78jGBTu3KNzxFbrDIJ0beEWK-dzr-53P_JN5o
 

dacharya64

Member
Contributor
First blog post is live! You can read it here: http://dacharya64.postach.io/post/gsoc-week-1-blocks-flags-and-a-simple-dirt-world

Here's the tl;dr:

Done:
  • Created a new world generator that creates a simple, flat world
  • Created the elements needed to spawn a the bases and flags within the world (Base.java, BaseProvider, BaseRasterizer, and BaseFacet) that hold the code needed to understand what a base is and place it within the world at a given set of coordinates on world generation.
  • Created logic to allow the flag to be picked up by pressing `E`, or by hitting it once (TakeBlockOnActivateComponent, TakeBlockOnActivationSystem)
  • Created prefabs for both flags and applied the LASTeam component so each can be identified as red or black, respectively
Light and Shadow PR: https://github.com/Terasology/LightAndShadow/pull/64
Light and Shadow Resources PR: https://github.com/Terasology/LightAndShadowResources/pull/23

To Do:
  • Allow player to choose faction (currently is implemented through NPC dialog)
  • On choosing faction, player is teleported to their team's base
  • Have faction designation affect whether player is able to collect/destroy blocks
    • Player cannot destroy own team's flag if flag is on base
    • Player can pick up either flag if not on the base
    • If picking up opposed faction's flag, flag is added to inventory
    • If picking up own faction's flag, flag is teleported back to base/spawn position
Blockers:
I'm not certain yet how to best implement players getting to choose their faction and how to handle the logic for handling different things that the players can do with the flags based on flag position and flag/player team. Hopefully talking more with the mentors at the meeting tomorrow will help to clarify some of this.
 

dacharya64

Member
Contributor
Week 2 is done! Unfortunately as I was working I encountered some weird problems that took a long time to diagnose, so didn't get a chance to test/push everything I was working on for this week yet.

Blog post with more details here: http://dacharya64.postach.io/post/gsoc-week-2-teaming-up

Done:
-Player has team faction component, set to white/neutral at start
-Team faction affects whether you can pick up flag or not (currently a work in progress, only is accurate for when the flag is on base)

Sort of done -- written but in need of more testing before pushing:
-Added bases to LaSWorld generator
-Player starts on floating platform and talks to NPC to choose faction
-On selecting team in NPC dialog, player is teleported to appropriate base, their LASTeam component is changed appropriately, and the dialog window is closed

To Do:
-Fix the current changes and PR them
-Rebase the last PR from L&SResources

Next week:
-Determine conditions for scoring
-UI for scoring
-Scoring logic (when player returns enemy flag to base, their team's score goes up by one)
-(Time permitting) Particle effects when flag is held
-Multiplayer testing

Blockers:
-Still need to set up a workspace on my desktop so that I can test multiplayer effectively
 

dacharya64

Member
Contributor
It's already the end of Week 3! That means a shiny new blog post and update:

Done:
-Teleporters for choosing teams spawns on FloatingPlatform
-Player can now activate teleporter which sets team to team of teleporter, and teleports player to appropriate base
-Tested that on team selected, player cannot pick up friendly flag on base but can pick up enemy flag
-Changed NPC dialog to reflect needing to activate teleporter to choose team

To Do:
-Proper win condition detection
--checking if player is holding enemy flag and back and friendly base, if so give a point to player's team
-Score UI -- display score of red and black teams permanently onscreen
-Fix style issues with current code
-(Time permitting) Allowing player to pick up their own teams' flag when flag is not at base, and on player doing so sending flag back to spawn point (at center of friendly base) instead of adding to player's inventory
-Multiplayer testing

Blockers:
None

PRs for this week:
https://github.com/Terasology/LightAndShadow/pull/65
https://github.com/Terasology/LightAndShadowResources/pull/24
 

dacharya64

Member
Contributor
End of the first evaluation round!

Blog post: http://dacharya64.postach.io/post/gsoc-week-4-merges-scores-and-first-evaluation

Done:
Score UI .ui file added, and text displays correct score (0) for each team at start of game
-ScoreSystem partially completed, should now detect when player is targeting the base and pressing `E` while holding enemy flag to increment the score (my idea is at base either having a button or some sort of place to deposit the enemy flag, but for now targeting anywhere on the base and activating with flag will increment team's score)
-Rewrote parts of base renderer and LASR blocks/prefabs to give bases team components
-Fixed style issue's with last week's PR
-Tested merge with develop in LAS to make sure everything was working properly

To Do:
-Figuring out how to properly update UI based on ingame score values
If I can get this working, I want to start moving on to gun stuff:
-Create raygun asset for player
-Have player get raygun added to inventory on teleport to base
-(Time permitting) Allowing player to pick up their own teams' flag when flag is not at base and on player doing so sending flag back to spawn point (at center of friendly base) instead of adding to player's inventory

Blockers:
-Trying to figure out this UI and scoring code and just how to implement it properly

PRs for this week:
https://github.com/Terasology/LightAndShadow/pull/67
https://github.com/Terasology/LightAndShadowResources/pull/25
 

dacharya64

Member
Contributor
Blog: http://dacharya64.postach.io/post/gsoc-week-5-keeping-score

Done
-ScoreSystem previously discussed now works
--Player can pick up enemy flag, then activate their base
--If they do so, their team's score increases by one
--UI is now bound properly to the score values, and updates when score increases

To Do
-Starting work on the Raygun stuff
--Creating an item for the player to equip to use to hit other players (or use Magic Wand?)
--Give item to player on teleport to base
--Starting on raycasting, time permitting

Blockers
Family stuff ended up taking some time away this week, going to try to get back on track time-wise

PRs for this week:
https://github.com/Terasology/LightAndShadow/pull/67
 
Last edited:

dacharya64

Member
Contributor
Blog: http://dacharya64.postach.io/post/gsoc-week-6-making-pvp-magic

Done:
-Made Magic Staff item
-Player is given magic staff on teleport to base
-Player can `activate` another player to attack them with magic staff
-If a player is attacked and holding a flag, this causes the flag to drop

To do:
-Investigate red teleporter not working
-Investigate syncing score across multiplayer clients
-Sort out some more mechanics questions/code
--Should players be able to cause their own team's flagbearer to drop the flag, or not? (Currently they can)
--When someone from the same team as the flag being picked up takes their flag, what should happen? (Currently adds to inventory, my plan is that it causes the flag to be teleported back to base/spawn point)
--Should someone be able to use their magic staff while having the flag in inventory? (Currently they can but I kind of think not)
--Flag drop needs to check whether a flag is in the inventory in general, not as it is currently (if the player is holding the flag/flag is selected)
-Lots more testing

Blockers:
None

PRs for this week:
LAS Player vs Player Combat Mechanics: https://github.com/Terasology/LightAndShadow/pull/68
LASR Adding magic staff item: https://github.com/Terasology/LightAndShadowResources/pull/26
 

dacharya64

Member
Contributor
Blog post: http://dacharya64.postach.io/post/gsoc-week-7-completing-the-gameplay-loop

Done:
-Checking if player has flag now searches inventory, not just checks held item
-Flag is now reset back in place on score increase or on being picked up by same team as its color
-UI improvements (color and font)

To Do:
-Attaching particle emitter to player with flag / detaching on flag loss
-Handling overall win/lose conditions (ex. if x team scores y points, reset flag placement and move players back to platform)
-Style changes and issues across multiplayer (ex. score HUD and magic fool NPC not appearing)

Blockers:
None


PRs for this week:
LAS: https://github.com/Terasology/LightAndShadow/pull/69
LASR: https://github.com/Terasology/LightAndShadowResources/pull/28
 

dacharya64

Member
Contributor
Blog post: http://dacharya64.postach.io/post/gsoc-week-8-scoring-goals-and-second-evals

Done:
-Checking if player has flag on scoring now searches inventory, not just checks held item
-Code refactoring for clarity and functionality and adding components for checks
-Code now supports GOAL_SCORE for score that team has to reach to win the overall game, and implementation of what happens if said team wins
-Changing UI color from gray to black for black team score

To Do:
-Figuring out why checking for a component (ex. hasComponent(RedFlagComponent.class)) on a held flag is not working when the flag is held, and how to get around this
-Attaching particle emitter to player with flag based on new HasFlagComponent
-Timer for individual capture the flag rounds (if no goal is scored in time limit, there is a tie and round is reset)
-Issues across multiplayer (ex. score HUD and magic fool NPC not appearing, setting permanent in-game time to daylight, etc.)

Blockers:
None

PRs for this week:
LAS: https://github.com/Terasology/LightAndShadow/pull/69
LASR: https://github.com/Terasology/LightAndShadowResources/pull/28
 

dacharya64

Member
Contributor
Blog post: http://dacharya64.postach.io/post/gsoc-week-9-flag-particles-and-synced-scoring

Done:
-Fixed issue with Components not being detectable when entity is held
-Score HUD now displays and syncs in client multiplayer
-Created particles for red and black team to add to player when flag held
-Particle effects on player when picking up flag
-Flag now removed from player when held and any team scores

To Do:
-Figure out if particles display in multiplayer in general, and if there's some fix if not
-Better handling attaching/detaching particles and HasFlagComponent in all cases of flag being taken/dropped
-Player Skinning for red and black teams
-Maze or other diverse terrain features

Blockers:
I'll be out of town for the next week, and will continue to work on the project but not sure about my online availability.
 

dacharya64

Member
Contributor
Blog post: http://dacharya64.postach.io/post/gsoc-week-9-flag-particles-and-synced-scoring

Done:
-Further fixes for the way particles are handled and displayed in multiplayer
-Particles now removed properly when player places flag in world
-Player skinning on selecting teleporter (adds blackPawn or redPawn skin depending on team selection)

To Do:
-Bug fixes for particles not removing and BlackPawn entity not displaying in multiplayer
-Improvements to player skinning (removing default box avatar)
-Working on level reset code for when one team wins (scores the # of points equal to the goal)
-Adding maze or other terrain features to the world for gameplay interest/difficulty

Blockers:
Still trying to figure out some of the trickier problems about parts of the client world not displaying/working properly, which will take more time and digging to solve.

PRs for this week:
Adding Client HUD and Score System: https://github.com/Terasology/LightAndShadow/pull/70
Adds particle effects and textures for when flag is held: https://github.com/Terasology/LightAndShadowResources/pull/29
 

dacharya64

Member
Contributor
Blog post: https://www.evernote.com/shard/s201/sh/755178eb-70a2-43bc-b77f-5a3ab9af8a55/c38eb5bc1c9d1b7cb907f3fa925d753c

Done:
-Particle effects now sync properly in multiplayer, got rid of redundancy
-Bases have separate colors/textures for red and black team
-Flag drop on attack now lands closer to attacking player

To Do:
+ Properly handling player skinning, with player skins appearing correctly rotated and player cube removed
+ Handling one team winning (reaching max score) and level reset
+ UI indication of which team a player is on when they choose a team
+ Maze in world gen

Blockers:
None

PRs for this week:
Adding Client HUD and Score System: https://github.com/Terasology/LightAndShadow/pull/70
Changes base blocks to be red/black depending on base instead of gray stone: https://github.com/Terasology/LightAndShadowResources/issues/30
 
Top