Commit Graph
100 Commits
Author SHA1 Message Date
OLEGSHA cc031529a1 Added OpenSimplex2 and a fancy world generator 2021-01-02 20:48:29 +03:00
OLEGSHA ea56b642ee Fixed PacketSendEntity
- Moved PacketSendEntity to correct package (.common.world.entity)
- Temporarily added position, velocity and direction to EntityData
read/write methods

- Increased view distance to 150 m
- Squashed visible area vertically (to load less underground and air
chunks)
2021-01-02 17:06:55 +03:00
OLEGSHA 16c89b963e Fixed test generator not populating chunks that were loaded from disk 2021-01-02 11:26:06 +03:00
OLEGSHA 8c6794e7da Merge branch 'master' into multichunk
Conflicts:
	src/main/java/ru/windcorp/progressia/server/ServerThread.java
2021-01-02 10:34:47 +03:00
OLEGSHA 7a9e03f700 Added generation hint persistence 2021-01-02 10:26:34 +03:00
OLEGSHA 65820040ce Added FPS and TPS display averaging 2021-01-02 00:37:12 +03:00
OLEGSHA 01645f5c6e Documented and prettified CrashReports 2021-01-02 00:08:32 +03:00
OLEGSHA 06f4b4637d Added world generation hints, altered ChunkIO slightly, fixed some bugs
- A custom Object can be appended to any ChunkData to save its
generation status
  - Handled by WorldGenerator
  - Persistent
  - Used to determine whether a chunk is ready to be sent to client
- ChunkIO now requires an IOConext
- ChunkIO now requires Data{In,Out}putStreams (as a combination of
Data{In,Out}put and {In,Out}putStream)
- Fixed some minor bugs
2021-01-01 23:06:32 +03:00
OLEGSHA 00773d4f8b Fixed compilation on JDK 8 2021-01-01 20:25:47 +03:00
OLEGSHA 77599e857d Introduced WorldGenerators 2020-12-31 15:36:21 +03:00
OLEGSHA 6e6701d2e5 Merge branch 'multichunk' 2020-12-30 14:49:59 +03:00
OLEGSHA 2947e9acff Add world persistence because I can
This is terribly inefficient both storage- and TPS-wise.
Enable/disable with ru.windcorp.progressia.test.TestWorldDiskIO.ENABLE
2020-12-30 14:47:43 +03:00
OLEGSHA ef928b382f Implemented TestChunkCodec and removed chunk generation from client 2020-12-30 14:22:34 +03:00
OLEGSHA c9087e7215 Spread chunk updates over several frames
- At most 1 chunk is updated (previously known as 'buildModel') every
frame
- 3x3x3 chunks closest to the player are updated in real-time without
the aforementioned limit
2020-12-30 00:29:25 +03:00
OLEGSHA 5d570a810b Fixed chunk load radius and removed debug leftovers 2020-12-29 16:56:15 +03:00
OLEGSHA b44540999b Entities are now transferred from server to client
- Entities are no longer internally bound to chunks
- Entity visibility for a player is now unique for each entity
  - Entities are send/revoked just like chunks by EntityManager
- LocalPlayer no longer stores an entity; instead it stores entity ID
and looks up the entity on demand
2020-12-29 16:40:37 +03:00
OLEGSHA cde854346c First implementation of dynamic chunk loading. Super buggy, WIP 2020-12-28 11:26:44 +03:00
OLEGSHA eaea6fdad9 Refactored Packets and most TickerTasks 2020-12-26 18:02:17 +03:00
OLEGSHA fd0269f913 Added the concept of visible chunks and entities 2020-12-26 15:25:28 +03:00
OLEGSHA c6677ec8fd Added ChunkMap and ChunkSet 2020-12-25 18:12:14 +03:00
OLEGSHA b6dd925c60 Tweaked dirt and stone textures 2020-12-22 20:23:11 +03:00
OLEGSHA f921acf317 Added generic implementations of of Chunk and World classes
Also fixed a whole bunch of missing Override annotations
2020-12-22 19:33:27 +03:00
OLEGSHA a582727cc0 Changed worldgen and made some minor changes in code 2020-12-22 10:57:39 +03:00
OLEGSHA e7b5ed3df4 Added Player server class
- Removed CommsChannel Roles
  - Replaced with Client class hierarchy on the server
- Added ClientPlayer
- Added Player (a new server class holding all objects related to a
player)
  - Player class in common renamed to PlayerData
  - Added PlayerManager for the server
2020-12-20 18:05:10 +03:00
OLEGSHA be1c1ab9ab Merge remote-tracking branch 'origin/master' into multichunk 2020-12-19 22:03:51 +03:00
OLEGSHA 32ba0c78e5 Added chunk transfer concept
- Added PacketLoadChunk
- Added ChunkIO to handle converting ChunkData to/from bytes
- Client no longer generates chunks by default
  - It still does generate them on request by server
- DataBuffer now exposes InputStream and OutputStream
2020-12-19 20:53:43 +03:00
OLEGSHA 8977f460ca OMG THE FOOL I WAS
- Faces are now grouped by texture primitive they use
  - Massive FPS increase
- TexturePrimitive receive an additional unique ID immediately upon
instantiation
2020-12-18 00:59:58 +03:00
OLEGSHA cd6e6d7d9c Texture coords are now precomputed in VBOs
Also optimized GLSL code and started using LOC in RenderPrograms
2020-12-18 00:30:22 +03:00
OLEGSHA 7cc4fcbffc Added dynamic text, fixed issues related to low FPS
- Hacked dynamic (quickly changing) text support into Typeface
  - No formatting for now
  - Requires a proper rewrite later
- Added DynamicLabel to display dynamic text
- Movement friction and player controls no longer depend on framerate
- Added FPS and TPS display
2020-12-17 00:25:39 +03:00
OLEGSHA bfd5c02b0c Added repeating tasks to TaskQueue 2020-12-16 17:05:12 +03:00
OLEGSHA 0a8db1cd02 Fixed crashes when using multiple chunks. FPS is still terrible though 2020-12-16 11:36:21 +03:00
OLEGSHA 4fa3592c98 Reworked tiles
- Now each block possesses its own set of 6 tile stacks; two tile stacks
occupy each block boundary
  - As consequence, top tiles of block (0;0;0) are now different from
bottom tiles of block (0;0;1)
- Tiles are now stored in and managed with TileStacks
- TileLocations were removed in favor of TileReferences
- Added tile tags to address individual tiles within TS in a way that
persists thru tile insertions are removals (used internally)
- Reworked TickContexts:
  - Changed and expanded interfaces significantly
  - Added TSTickContext
  - Replaced Mutable*TickContexts with TickContextMutable
- Split AddOrRemoveTile into two separate actions
- Renamed EdgeTileLogic to HangingTileLogic
- Moved tmp_generate into TestContent
- Removed Forwarding*TickContexts for now
- Fixed TileTriggeredUpdate triggering ticks instead of updates
- Fixed an error message in Ticker
2020-12-14 21:48:55 +03:00
OLEGSHA 89e24b05c0 Grass tiles in unsuitable locations now disappear slowly 2020-12-01 23:49:55 +03:00
OLEGSHA f8e763c0d6 Fixed #3 - implemented random ticks, refactored Ticking* interfaces
- Random ticks now happen
- Ticking* interfaces now have a single getTickingPolicy method instead
of two doesTick* methods. This makes more sense since an object cannot
both tick randomly and regularly.
- Added Server.stop
- Added some convenience methods related to setting blocks and tiles
- Documented some stuff
2020-12-01 22:37:18 +03:00
OLEGSHA 377241c529 Removed MICRO SIGN U+00B5 from program source for Windows compatibility 2020-12-01 16:53:04 +03:00
OLEGSHA 73f90c69e5 Fixed several problems with Units 2020-12-01 12:27:30 +03:00
OLEGSHA 3782cf1f88 Added unit registration to Units and Units.get methods
These are just convenience methods: instead of writing
float g = 9.8f * Units.METERS_PER_SECOND_SQUARED;
we can write
float g = Units.get("9.8 m/s^2");
and it'll actually work fast.
2020-12-01 01:28:18 +03:00
OLEGSHA 4c3f5caae6 Working on #3 - Implemented entity ticking 2020-11-30 23:07:15 +03:00
OLEGSHA 9dbeeb7e8d Working on #3 - implemented chunk ticking in general and regular ticks 2020-11-28 00:29:40 +03:00
OLEGSHA 2d322e83bc I've had it with LowOverheadCaches
Benchmarking showed that using LOC gave a whopping 5% speed advantage at
the cost of terrible readability. In the worst case. Decided that having
clear, laconic and Java-style code is worth the drop in performance.
2020-11-27 23:54:41 +03:00
OLEGSHA 44de6a86f7 Dumped server ticking code into the Mariana Trench and rewritten it
No regrets.

- Pretty much everything related to ticking changed
- Ticking is now capable of running in parallel (other code - not so
much)
- Implemented world updates
- Broke some stuff
2020-11-27 00:56:56 +03:00
OLEGSHA 64390347a8 Fixed a couple literals in CrashReports 2020-11-24 13:53:53 +03:00
OLEGSHA e3315f62a8 Merge pull request #1 from OLEGSHA/audio 2020-11-22 17:25:46 +03:00
OLEGSHA ce2d4297dd Fixed compilation problems and added MultiLOC
(MultiLOC is MultiLowOverheadCache)
2020-11-21 23:51:14 +03:00
OLEGSHA 372f173723 Introduced ChunkData and WorldDataListeners
- Added ChunkDataListener and WorldDataListener
- Moved chunk render update requests to clientside ChunkDataListeners
- Moved ChunkRender and ChunkLogic initialization into WDListeners
2020-11-20 23:54:32 +03:00
OLEGSHA 7f381c7a1f Updated block selection display and added block placing
- Packaged everything related to block selection into Selection class
- Selection box is a bit less obnoxious
- Added the ability to place Test:Stone blocks





- This is technically a Minecraft clone now. I don't know how to feel
about this tbh
2020-11-20 11:50:24 +03:00
OLEGSHA a7eb90865f Merge branch 'crashreports' 2020-11-19 19:11:30 +03:00
OLEGSHA afa1234ddd Fixed English in messages 2020-11-19 18:59:41 +03:00
OLEGSHA c5ae4e5ab9 Fixed falling through blocks 2020-11-19 17:51:45 +03:00
OLEGSHA cf18da8350 Added block breaking and refactored Controls
- Blocks can be broken by pointing at them at pressing LMB
- Rewritten ControlTriggers
- Rewritten KeyMatcher
- CollisionPathComputer now has a 0.5 margin
2020-11-17 22:53:56 +03:00
OLEGSHA 56eaec522f Renamed NamespacedRegistry and added NamespacedFactoryRegistry
- NamespacedRegistry moved to NamespacedInstanceRegistry
- Added NamespacedFactoryRegistry
2020-11-17 16:49:31 +03:00
OLEGSHA 5d7cfdb3bc Refactored Namespaced stuff
- Namespaced now takes full ID in constructor
  - Changed the rest of source accordingly
- Moved everything related to Namespaced into .util.namespaced package
- Errors are now reported with IllegalIdException instead of IAE
- Error checking is optimized
- NamespacedUtil exposes more of its requirements
- Added StringUtil.splitAt
- Added ArrayUtil.isSorted
2020-11-17 12:46:33 +03:00
OLEGSHA b51b3a4d80 Blocks looked at are now highlighted 2020-11-16 18:02:41 +03:00
OLEGSHA b987412670 Added StringUtil.replaceAll 2020-11-15 21:11:07 +03:00
OLEGSHA f2e28161a8 Added human player model
- Extracted NPedModel out of QuadripedModel
  - Both are now configurable
- Added HumanoidModel
- Added human model
- Changed NPedModel animation logic
- Added a few skins including first sketch of Pyotr by WarDreg
- Decreased walking speed
2020-11-15 20:58:17 +03:00
OLEGSHA 38a8a885c8 Updated build.gradle to make build artifacts easily runnable 2020-11-14 21:58:48 +03:00
OLEGSHA 154cc0a3b8 Added gravity and refactored player controls
- Added gravity (still testing)
  - Two modes: realistic (9.8 m/s^2) and Minecraft (32 m/s^2)
  - Switch with G
    - Changing (0; 0; 0) rebound to H
- Added walking controls
  - Minecraft-style
  - WIP
- LayerTestGUI now displays dev options
- Added Units
2020-11-14 13:49:35 +03:00
OLEGSHA 9c894215f8 Added collisions with world 2020-11-13 21:45:05 +03:00
OLEGSHA 0dd5e6d3da Increased encapsulation of AABBs and added TranslatedAABB
- Interface of AABB (getOrigin(), getSize() and getWall(int)) now
extracted into AABBoid interface
  - Same with Walls
  - Collection<Wall> getWalls() replaced with Wall getWall(int)
- Added TranslatedAABB extends AABBoid
- CollisionClock replaced with direct reference to WorldData
- Reorganized tmp code in LayerWorld, so as to decrease cRiNgE_ levels
2020-11-12 23:13:41 +03:00
OLEGSHA ececa9506d Merge remote-tracking branch 'origin/master' into audio 2020-11-10 01:31:53 +03:00
OLEGSHA a425af01d8 Merge remote-tracking branch 'origin/master' into crashreports 2020-11-10 01:29:29 +03:00
OLEGSHA 0017ecc5a7 Refactored CrashReportGenerator to avoid deadlocks and clarify code 2020-11-10 01:25:42 +03:00
OLEGSHA 88d5170fe5 Added CompoundColliderModel 2020-11-08 20:22:32 +03:00
OLEGSHA 09af026137 Implemented first version of collider
- Entities now can have an AABB collision model
- Collisions of pairs of entities are handled properly
- Added debug display of AABBs
2020-11-08 18:26:33 +03:00
OLEGSHA 1daec9a4df Untangled some of the mess with movement controls in LayerWorld
Now entity getVelocity() method matches actual velocity for player
entities.

WTF was I thinking when I wrote that code? Past me very stupid.
2020-11-08 12:46:12 +03:00
OLEGSHA 1c5c91a712 Updated Guava to 30.0 to resolve SNYK-JAVA-COMGOOGLEGUAVA-1015415
Relevant info: https://github.com/google/guava/issues/4011. We never
used it but better prevent this in the future.
2020-11-05 12:33:13 +03:00
OLEGSHA 044c690d09 Code Review
- Renamed CrashReportGenerator.makeCrashReport to .crash for convenience
- Split .crash into subroutines
- Documented Analyzer and ContextProvider
  - Both are now supposed to have names In Title Case
- CRG.export now assumes PrintStream does not fail and assumes Log can
fail
2020-11-05 12:14:03 +03:00
OLEGSHA e7e54d0ffd Code review 2020-11-02 17:27:17 +03:00
OLEGSHA 5c90a8025b Refactored sound update logic
- Audio Listener now uses Camera cache to determine position and
orientation
- SoundManager.update() is not triggered from RenderThread directly
2020-10-06 12:15:58 +03:00
OLEGSHA 3057910269 Merge remote-tracking branch 'github/master' into audio 2020-10-06 11:44:32 +03:00
OLEGSHA 503963f992 Cleaned up and formatted code 2020-10-06 11:42:36 +03:00
OLEGSHA b59c4bdc2b Camera now stores last applied position and direction
Also FloatMathUtils now has sin, cos and tan
2020-10-04 19:50:52 +03:00
OLEGSHA a9d2a7f6c5 Added stateful objects
Also added entity logic, moved test content to a separate package,
changed ImplementedChangeTracker a bit, added PacketEntityChange, made
entity IDs longs instead of UUIDs, and changed a whole bunch of minor
stuff.

Damn, this took CENTURIES to write. And it's still incomplete and crap.
Like, we've got object allocation all over the place in the tick cycle,
stateful changes are potentially super inefficient and we might have
concurrency problems down the line. AND I'll still have to write 10000
primitive wrappers. Urgh. I don't even feel like writing a coherent
commit message. Screw you, potential future reader of this commit
message.
2020-09-28 22:39:01 +03:00
OLEGSHA ccc9d8f3a7 Refactored Camera to use anchors
- Camera now uses anchor objects to obtain position and direction
  - Replaceable at runtime
  - Anchor supplies info about camera modes (switch with F5)
  - Only Entity anchor implemented ATM
- Added PacketSetLocalPlayer
- EntityRenders now produce EntityRenderable
  - Holds reference to EntityData
  - Has getViewPoint() to use with camera anchors
- Added Matrices (like Vectors)
- Added FloatMathUtils for all those pesky math functions that are only
implemented for double. Curse you double!
2020-09-07 10:16:52 +03:00
OLEGSHA c613bef8c5 Added face culling state stack and disabled face culling for entities 2020-09-05 23:26:54 +03:00
OLEGSHA 9dc3154874 Added entities
- Added EntityData, EntityRender and EntityLogic
  - Added QuadripedModel
- Added ComplexTexture to simplify syntax when working with complex
models
- Added the most adorable creature in the universe (as a test feature)
- Camera is now 3rd person (temporary)
  - Direction can now be switched with F5
2020-09-04 21:54:55 +03:00
OLEGSHA aa3cb630fb Fixed LayoutVertical 2020-09-02 09:15:54 +03:00
OLEGSHA 068f229a45 Added TileLogic 2020-08-31 20:39:35 +03:00
OLEGSHA fcf5da731f Fixed buffer position and limit handling in Resource.readAsBytes 2020-08-31 18:39:35 +03:00
OLEGSHA 6afb7f8f1b Added Resource.readAsBytes to read a resource to a ByteBuffer 2020-08-31 18:32:54 +03:00
OLEGSHA 3ff074e384 Unified naming schemes for blocks, tiles and registries
- Blocks are now in packages *.world.block
- Tiles are now in packages *.world.tile
- Renamed WorldRenderable to Renderable
- GraphicsInterface now exposes frame counter
  - ...which is now a long
- Removed leftover debug FPS console spam
2020-08-31 15:15:04 +03:00
OLEGSHA 30e61cf33f Added server and reorganized client
- Added server
  - Managed with ServerState
- Added BlockLogic (no TileLogic yet)
- Added ticking
- Added server-client communication API (only local implemented, no net)
  - Added controls system (not fully implemented)
- Added Client class
  - Contains most game-related references for client: WorldRender,
Camera, ...
  - Managed with ClientState

fjckign finally~
2020-08-30 19:30:32 +03:00
OLEGSHA 79c7aa91f8 Optimized tile render and added CRO tile support
- CROs now support tiles
  - CROCube refactored
- Test content:
  - Added sand and flower tiles
  - Removed grass blocks, added grass tiles
2020-08-27 20:58:27 +03:00
OLEGSHA 60fbfa9578 Added tiles. Not yet optimized. 2020-08-27 00:24:11 +03:00
OLEGSHA 21a30e8b97 Created fast Vec caches and increased the use of Vecs in code 2020-08-26 20:58:38 +03:00
OLEGSHA 65eaae68a8 Added some packages from JPUtil (https://github.com/OLEGSHA/JPUtil)
- ru.windcorp.common.util.ThrowingRunnable replaced with
ru.windcorp.jputil.functions.ThrowingRunnable
2020-08-26 18:34:52 +03:00
OLEGSHA a9896fa3e1 Refactored CROs and CROCube, Faces.createBlockFace and Camera
- Multiple ChunkRenderOptimizers can now optimize one block if desired
  - CROs require that an interface is implemented, not class extended
- ChunkRenderOptimizerCube has been refactored:
  - Blocks that a not opaque are now optimized
  - Blocks have per-face opacity
  - Blocks can render inner faces
    - Example: test glass
  - Code is now readable
- Faces was rewritten to support flipping
  - .createBlockFace is now readable
- Camera now manipulates coordinate systems in a more obvious way
  - Camera now uses world coordinate system
    - Z is up
    - Yaw 0 looks to the North (+X)
    - Positive pitch is up
  - Improved control code readability somewhat
  - Fixed test UI compass
2020-08-26 01:34:32 +03:00
OLEGSHA bdb458b911 Renamed BlockRenderOptimizer to ChunkRenderOptimizer
Also renamed [BRO]Generator to [CRO]Supplier
2020-08-25 21:21:22 +03:00
OLEGSHA d58d028e1c Begun refactoring chunk render. Not implemented properly. 2020-08-25 21:11:55 +03:00
OLEGSHA 1caf82bf8c Minor updates in Building section of README.md
- Added encoding specification instructions for Eclipse IDE
- Fixed formatting
2020-08-25 20:38:25 +03:00
OLEGSHA e1ce8c2e09 Added GNU Unifont typeface, optimized TextureDataEditor greatly
- Added GNU Unifont support
- TextureDataEditor no longer uses AWT internally
  - Optimized Atlases slightly
- SpriteTypeface adds spacing between lines
- Removed TestTypeface
2020-08-17 22:22:13 +03:00
OLEGSHA 54002475d0 Added SpriteTypeface that implements text styling and layout 2020-08-16 20:37:42 +04:00
OLEGSHA 0e99685583 Added test text rendering
- Added Typeface
- Added Font (Typeface + style)
- Added Label to display text in GUI
- Added Panels to quickly group Components
- Added a test font
  - Ignores all parameters but text itself
  - Only ABCD are supported (no whitespace)
2020-08-16 08:31:06 +04:00
OLEGSHA 4370c523e6 Flipped Y-axis in flat layers and cursor input. Now (0; 0) is lower left 2020-08-15 22:35:45 +04:00
OLEGSHA eb6945b017 Fixed block atlas size 2020-08-15 22:20:42 +04:00
OLEGSHA 6d2adb0f31 Refactored texture loading system to allow runtime editing and atlases
- Removed TextureManager, use TextureLoader instead
  - Removed PngLoader, AWT image compat moved to TextureUtils
- Pixels renamed to TextureData
- Added TextureDataEditor for runtime editing of TextureData
- Added SimpleTextures to load random, one-off textures
- Added Atlases to load textures into runtime-compiled atlases
  - BlockRenders now contains a method to load a block texture properly
- Moved block textures into assets/textures/blocks/
2020-08-15 22:15:26 +04:00
OLEGSHA aeed34d105 Changed name to Progressia in README and file headers 2020-08-10 14:07:53 +04:00
OLEGSHA 4cf0324f1a Moved everything into ru.windcorp.progressia package 2020-08-10 12:22:45 +03:00
OLEGSHA 45b0ad2888 Switched back to GLSL 1.20 because my laptop is a brick 2020-08-09 11:40:41 +03:00
OLEGSHA 1362dab2c1 Updated BinUtil and CoordinatePacker
- Added packing 2 ints into a long to CoordinatePacker
- Added iPowerOf2(int) to BinUtil
2020-08-06 21:36:45 +03:00