Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5c623e5
#31 - Restoring semblance of flight scene and tweaking menu options
paulbrzeski Dec 31, 2025
ca51e72
#31 - Beginning finalisation of hangar scene and features, as well as…
paulbrzeski Dec 31, 2025
d87a9f7
#31 - Changing vehicles to all use the new base class
paulbrzeski Jan 17, 2026
b961d98
#31 - Adding new ECS oriented overworld config
paulbrzeski Jan 24, 2026
df5f6f6
#31 - Adding start of ECS game engine architecture
paulbrzeski Jan 24, 2026
1b24a7c
#31 - Adding Transform component and Vec3 types
paulbrzeski Jan 24, 2026
38bb0ea
#31 - WIP Movement system
paulbrzeski Jan 31, 2026
ddec4cd
#31 - Implementing object configs and WIP Motion component
paulbrzeski Mar 9, 2026
dc5dfb7
#31 - Flattening entity structure
paulbrzeski Mar 9, 2026
94abf5e
#31 - Renaming max speed to limits
paulbrzeski Mar 9, 2026
6271727
#31 - Updating Director loadObject and setting default transforms
paulbrzeski Mar 11, 2026
7e9c5e4
#31 - Flipping overworld scene load order and director tweaks
paulbrzeski Mar 13, 2026
b825519
entity
paulbrzeski Apr 9, 2026
6f71a69
#31 - Updating instance variable references to use motion components
paulbrzeski Apr 10, 2026
9ebf6d4
#31 - Resetting vehicle rotation Y to 0 in config
paulbrzeski Apr 10, 2026
d8944ba
#31 - Updating remaining player game object references
paulbrzeski Apr 28, 2026
172e265
#31 - Implementing scanner components and vehicle configs
paulbrzeski Apr 28, 2026
b008a79
code
paulbrzeski May 5, 2026
3735252
#31 - Adding dummy scanner and weapons via ECS
paulbrzeski May 9, 2026
808032c
#31 - AI ECS component and begun writing scanner subsystem
paulbrzeski May 9, 2026
78b29ac
#31 - Fixing debugging tools
paulbrzeski May 13, 2026
b0211f7
#31 - Restored cargo ship to scene
paulbrzeski May 13, 2026
1e8cb6e
#31 - WIP AI system in game engine
paulbrzeski May 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions client/src/app/routes/hangar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ export default class hangarRoute {

loadHangar() {
l.current_scene.scene.add(l.scenograph.objects.structures.hangar.mesh);
//this.targetStructure.visible = false;

l.scenograph.objects.structures.hangar.mesh.visible = true;
console.log(this.targetStructure.userData.config.hangars[0].position);

l.scenograph.objects.structures.hangar.mesh.position.x = this.targetStructure.userData.config.hangars[0].position.x;
l.scenograph.objects.structures.hangar.mesh.position.y = this.targetStructure.userData.config.hangars[0].position.y;
l.scenograph.objects.structures.hangar.mesh.position.z = this.targetStructure.userData.config.hangars[0].position.z;

l.scenograph.actors.player.vehicle.mesh.userData.object.position.x = this.targetStructure.userData.config.hangars[0].position.x;
l.scenograph.actors.player.vehicle.mesh.userData.object.position.z = - 2.5 + this.targetStructure.userData.config.hangars[0].position.z;
l.scenograph.actors.player.vehicle.mesh.userData.object.position.y = l.scenograph.objects.structures.hangar.mesh.position.y - 7.5;
l.scenograph.actors.player.vehicle.game.components.Transform.position.position.x = this.targetStructure.userData.config.hangars[0].position.x;
l.scenograph.actors.player.vehicle.game.components.Transform.position.position.z = - 2.5 + this.targetStructure.userData.config.hangars[0].position.z;
l.scenograph.actors.player.vehicle.game.components.Transform.position.position.y = l.scenograph.objects.structures.hangar.mesh.position.y - 7.5;

l.scenograph.actors.player.actorInstance.object.position.x = this.targetStructure.userData.config.hangars[0].position.x;
l.scenograph.actors.player.actorInstance.object.position.z = 10 + this.targetStructure.userData.config.hangars[0].position.z;
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/routes/singleplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ export default class singlePlayerRoute {
// Set client mode.
l.mode = 'single_player';

l.scenograph.actors.map.get('Player One').setMode('vehicle');
l.scenograph.actors.player = l.scenograph.actors.get('Player One');
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be set in menu logic

l.scenograph.actors.player.setMode('vehicle');

}

Expand Down
8 changes: 4 additions & 4 deletions client/src/app/scenograph/actors.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export default class Actors {
this.map = new Map();
}

async registerActor(actorInstance) {
if ( actorInstance.config.class == 'player' ) {
let player = new Player( actorInstance );
async registerActor(actorEntity) {
if (actorEntity.config.components.PlayerInput) {
let player = new Player( actorEntity );
await player.load();
this.map.set(actorInstance.config.name, player);
this.map.set(actorEntity.components.Name, player);
}
}

Expand Down
8 changes: 4 additions & 4 deletions client/src/app/scenograph/actors/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default class Player {
// Vehicle model.
vehicle;

constructor( actorInstance ) {
constructor( actorEntity ) {

this.actorInstance = actorInstance;
this.actorEntity = actorEntity;

this.ready = false;

Expand All @@ -53,7 +53,7 @@ export default class Player {
async load() {

// Setup aircraft, used for the intro sequence.
this.vehicle = new l.scenograph.objects.vehicles.valiant();
this.vehicle = new l.scenograph.objects.vehicles.valiant(this.actorEntity);
await this.vehicle.load();
l.current_scene.scene.add(
this.vehicle.mesh
Expand All @@ -63,7 +63,7 @@ export default class Player {
);

// Setup person, used for the hangar scene.
this.person = new l.scenograph.objects.vehicles.person(this.actorInstance);
this.person = new l.scenograph.objects.vehicles.person(this.actorEntity);
l.current_scene.scene.add(
this.person.mesh
);
Expand Down
26 changes: 13 additions & 13 deletions client/src/app/scenograph/controls/touch/weapons.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Touchscreen Weapon Controls
*
*
*/

/**
Expand All @@ -9,24 +9,24 @@
import l from '@/helpers/l.js';

export default class WeaponControls {

/**
* Switch indicating we are currently attacking.
*
* @type {boolean}
*
* @type {boolean}
*/
attack;

/**
* Switch indicating auto attack is on.
*
* @type {boolean}
*
* @type {boolean}
*/
autoAttack;

/**
* HTML Container
*
*
* @type {HTMLElement}
*/
container;
Expand All @@ -39,7 +39,7 @@ export default class WeaponControls {

this.container.querySelector('.switch input').onchange = ()=>{
l.scenograph.controls.touch.weapons.autoAttack = l.scenograph.controls.touch.weapons.container.querySelector('.switch input').checked;
};
};

this.container.querySelector('button').onclick = ()=>{
l.scenograph.controls.touch.weapons.attack = true;
Expand All @@ -53,10 +53,10 @@ export default class WeaponControls {

/**
* Update hook.
*
*
* This method is called within the UI setInterval updater, allowing
* HTML content to be updated at different rate than the 3D frame rate.
*
*
* @method update
* @memberof WeaponControls
* @global
Expand All @@ -67,9 +67,9 @@ export default class WeaponControls {

let timeRemaining = 0;

if ( parseInt(l.current_scene.stats.currentTime) < parseInt(l.scenograph.actors.player.vehicle.mesh.userData.actor.weapons.last) + parseInt(l.scenograph.actors.player.vehicle.mesh.userData.actor.weapons.timeout) ) {
timeRemaining = parseInt(l.scenograph.actors.player.vehicle.mesh.userData.actor.weapons.timeout) - (
parseInt(l.current_scene.stats.currentTime) - parseInt(l.scenograph.actors.player.vehicle.mesh.userData.actor.weapons.last)
if ( parseInt(l.current_scene.stats.currentTime) < parseInt(l.scenograph.actors.player.vehicle.game.components.Weapon.last) + parseInt(l.scenograph.actors.player.vehicle.game.components.Weapon.timeout) ) {
timeRemaining = parseInt(l.scenograph.actors.player.vehicle.game.components.Weapon.timeout) - (
parseInt(l.current_scene.stats.currentTime) - parseInt(l.scenograph.actors.player.vehicle.game.components.Weapon.last)
);
}

Expand Down
65 changes: 31 additions & 34 deletions client/src/app/scenograph/director.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import l from '@/helpers/l.js';
/**
* World Simulation
*/
import World from '#/game/src/world';
import World from '#/game/ecs/world';

/**
* Scene controllers
Expand Down Expand Up @@ -231,9 +231,9 @@ export default class Director {

// Load world instance from game classes.
load( sceneName ) {
this.world = new World( sceneName );
this.world = new World(sceneName);

return this;
return this;
}

// Load the objects in world instance to the current scene.
Expand All @@ -246,70 +246,67 @@ export default class Director {
}

async loadInstance() {
console.log(this.world);
await this.world.entities.forEach(async entity => {

await this.world.config.objects.forEach( async object_config => {
if ( object_config.model == 'extractor' ) {
if ( entity.config.components.Renderable.object == 'extractor' ) {
l.scenograph.director.loadObject(
object_config,
entity,
await l.scenograph.objects.structures.extractor.get()
);
}
if ( object_config.model == 'platform' ) {
if ( entity.config.components.Renderable.object == 'platform' ) {
l.scenograph.director.loadObject(
object_config,
entity,
await l.scenograph.objects.structures.platform.get()
);
}
if ( object_config.model == 'refinery' ) {
if ( entity.config.components.Renderable.object == 'refinery' ) {
l.scenograph.director.loadObject(
object_config,
entity,
await l.scenograph.objects.structures.refinery.get()
);
}
} );

this.world.config.actors.forEach( async object_config => {
if ( object_config.class == 'cargoShip' ) {
if ( entity.config.components.Renderable.object == 'cargoShip' ) {
l.scenograph.director.loadObject(
object_config,
await l.scenograph.objects.vehicles.cargoShip.get()
entity,
await l.scenograph.objects.vehicles.cargoShip.get(entity)
);
}
if ( object_config.class == 'pirate' ) {
if ( entity.config.components.Renderable.object == 'pirate' ) {
l.scenograph.director.loadObject(
object_config,
entity,
await l.scenograph.objects.vehicles.raven.get()
);
}

} );

this.world.instance.actors.forEach(async actorInstance => {
if ( actorInstance.config.class == 'player' ) {
await l.scenograph.actors.registerActor( actorInstance );
if (entity.config.components.Renderable.object == 'valiant' || entity.config.components.Renderable.object == 'person') {
await l.scenograph.actors.registerActor( entity );
}
});

}

async loadObject( config, object ) {
object.position.x = config.position.x;
object.position.y = config.position.y;
object.position.z = config.position.z;
async loadObject(entity, scenographObject) {
console.log(entity, scenographObject);
scenographObject.position.x = entity.components.Transform.position.x;
scenographObject.position.y = entity.components.Transform.position.y;
scenographObject.position.z = entity.components.Transform.position.z;

if ( config.rotation ) {
object.rotation.x = config.rotation.x;
object.rotation.y = config.rotation.y;
object.rotation.z = config.rotation.z;
if ( entity.rotation ) {
scenographObject.rotation.x = entity.components.Transform.rotation.x;
scenographObject.rotation.y = entity.components.Transform.rotation.y;
scenographObject.rotation.z = entity.components.Transform.rotation.z;
}

object.name = config.name;
object.userData.config = config;
scenographObject.name = entity.components.Name;
scenographObject.userData.entity = entity;

// @todo: add to current_scene array relevant to object class.
// @todo: add to current_scene array relevant to scenographObject class.

l.current_scene.scene.add(
object
scenographObject
);
}

Expand Down
Loading