Espen Breivik

June 3, 2021

Discgolf Again - Dev Diary: Days 0 to 5

Posted the first 5 days of the diary since I did all the notes from them today

image.png


Day 0 (?)

  • Test Terrain-addon by Zylann - very nice!
  • Test sky-shader by Lexpartizan- very nice! Drawback that this isn't an add-on. I like "cleanness" of keeping addons separate and requiring no additional hacking to get it working.
  • Tested God Rays, but couldn'nt get it working :(
  • Seems like it is possible to find basic assets now, much better than last time I checked.
  • Very impressed so far - it seems that the terrain editor and sky shader will cover the needs. Relieved, this means that Godot is actually a viable option. The internal UI is also much better now. So let's give it a go!

Day 1 (25.05.21)

  • Test asset import of trees, lots of problems with FBX
  • Finally found a tree from Sketchfab and used auto-converted gltf, scaled down to about 0.01
  • Added crude tree collision
  • Struggled a bit with leaf material and alpha blending (blends with sea somehow? - still a problem)
  • Used test scene from Terrain addon and tested basic collision

Day 2 (?)

  • Made disc object instead of default cube, assuming 1u = 1m in general in the engine
  • Found out that RigidBody had to be the local scene root node
  • Struggled with reseting physics state but solved in an ugly, async way with flags and _integrate_forces
  • Struggled with Vector3-graphics to position forces, at this point I was close to giving up. Math is hard!

Day 3 (02.06.21)

  • Read some more docs and figured out how to rotate the direction! right = Quat(Vector3.UP, deg2rad(90.0)).xform(dir).normalized()
  • Figured out I had to disable the sleep-state to avoid missing the "reset" event (_integrate-forces isn't called when sleeping)
  • Implemented basic algo based on https://discpath.haxor.fi/ - ignoring disc wear
  • Hard to get the LSF to go correctly. Tweaking a lot with force constants but not happy. Seems to be contributing too little on high-power throws and too much on low-power. Resisting urge to spend lots of time on headless tweaking.

Day 4 (03.06.21)

  • Started providing debug UI and basic controls
  • Actually struggled to reference nodes inside the scene, surprisingly hard. Remember to use find_node with owner = false
  • Still annoying to use because of the default mouse look script in the Terrain Demo, will have to modify this
  • Started connecting signals to update labels. I have mixed feelings about signals, I really want to use them and like them - but they feel a bit fragile since they will break on hierarchy changes. It might also be confusing to mix signal connections in the scene file and inside scripts, but they are very easy and powerful to use so let's try them out!
  • Still tried to tweak LSF - this is wrong. Will have to tweak it later. Resisting the urge to spend lots of time on headless tweaking.
  • Side note: There is an impressive amount of Godot Q&A on the internet, can find answer to many questions!

Day 5 (04.06.21)

  • Improved the UI a little bit, added button - but annoying that space (fly up) is also throwing discs
  • Copied and modified mouse-look script, uses right-mouse hold to adjust button now
  • Preliminary player-move-after-disk and disk landing detection (basically checking linear-velocity less than a small number and airspeed == 0) 
  • Imported old asset from Sketchup format via Blender (via a Sketchup-plugin) and re-exported back to gltf format, worked out very well except having to delete Camera + Light from model before exporting
  • Worked on collision shapes, got most working
  • Struggled with damping for the Area representing the chains, might have to do a workaround