Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1412012 Posts in 69461 Topics- by 58492 Members - Latest Member: Gods Of Fire

July 03, 2024, 07:48:24 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsMoonQuest
Pages: 1 ... 108 109 [110] 111 112 ... 189
Print
Author Topic: MoonQuest  (Read 1354620 times)
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2180 on: January 15, 2014, 06:16:21 PM »

Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2181 on: January 18, 2014, 09:14:02 PM »

Update: The refactoring is going well but slower than I like. I added a temporary component refactoringcomponent which serves as a shim between the old system and the new one. It's a mega component that stores _all_ the attributes, which I incrementally reduce as each attribute is refactored out. I started adding some components, like transform which just stores the position of an entity, aicontrol which lets the ai system control an entity, and humanoidcontrol which is basically a human without a control. For debugging purposes the components can print out their contents. For example some of the components in a human entity (id=2) are printed below.

Entity 2
  transform {x: 367.819, y: 319.005}
  refactoringcomponent {
    old_x: 367.708
    old_y: 319.005
    vx: 3.33333
    vy: 1.65674e-008
    on_ground: true
    on_ladder: false
    max_ground_speed: 5
    max_jump_force: 8
    health: 14
    health_max: 14
    recovery_timer_ms: 0
    blood_colour: 4278190335
    is_flammable: true
    ...
  }
  aicontrol {physicsId: 0, init: false, decisionTimer: 0, chaseTimer: 0, chasingMoonman: false, checkGroundTimer: 0, isJumping: false}
  humanoidcontrol {...}
}
Logged

kleiba
Level 2
**



View Profile
« Reply #2182 on: January 21, 2014, 10:36:38 AM »

Let's all send some cheers out to eigenbom!  Hand Thumbs Up Right Apparently, he's serious about finishing the Moonman this year! Good on ya, mate!

I'm just saying this because it kinda sucks not to have this devlog on the front page every time I come to the forum. But knowing that it's for a greater good makes it bearable.  Gentleman
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2183 on: January 21, 2014, 12:39:41 PM »

Hey thanks kleibs. I've been busy doing the refactor, it's all boring stuff, but when I get back to features I'll be posting more again. :D
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2184 on: January 21, 2014, 08:53:22 PM »

Update: Refactored many components now, but stilling wrestling with random crashes and annoying things. I also cleaned up some of the system logging stuff, here's the starting log, telling me how much memory I'm allocating for each component. It's currently set low to speed up booting.

Code:
Logger started
Loading settings
Finding core package path
Initialising font
Platform: Windows
OpenGL 4.2
Loading core resources (NOT THREADED)
Creating entity system
Setting up components
-----------------------------------------------------
Allocated 0.13M for Transform
Allocated 1.91M for RefactoringComponent
Allocated 0.21M for Physics
Allocated 0.02M for AIControl
Allocated 0.17M for HumanoidControl
Allocated 0.39M for Inventory
Allocated 0.01M for Interactive
Allocated 0.14M for SimpleSprite
Allocated 4.20M for SpriteDriver
-----------------------------------------------------
Creating component systems
Creating other systems
Creating renderer
...
Logged

kleiba
Level 2
**



View Profile
« Reply #2185 on: January 23, 2014, 10:47:45 AM »

Have you considered running a static code analysis tool on your code base?
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2186 on: January 23, 2014, 04:34:56 PM »

Hey kleibs, yeah I've run msvc's static code analyser, it's pretty interesting. It basically just picked up a few uninitialised variables or complained about potential memory access errors - most of which were covered by checks in my code.

Update: Refactored the physics and sprite components, which were some of the largest. Here's what some of the new code looks like when using the Health component -- which you'll note is similar to the toy system I described a few pages back. Things are coming together, slowly.

Code:
void handleEvent(const EvDamageEntity& ev){
  Entity& e = gCore->entitySystem->lookup(ev.entity);
  if (e.has<Health>()){
    Health& h = e.get<Health>();
    h.health -= ev.amount;
    if (h.health <= 0){
      queueEvent(EvKillEntity(ev.entity));
    }
  }
}
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2187 on: January 28, 2014, 05:33:02 PM »

Update: Most of the stuff is refactored now, there's just a couple of remaining old-style attributes that I need to work on. Here's a print out of a new type entity and its components. The line + Transform 2 {...} specifies that Entity 2 has an enabled (+) component called Transform that has id=2 and contents {...}.

Code:
Entity 2
  + Transform 2 {x: 353.23, y: 319.007}
  + RefactoringComponent 2 { sprite_map_id: 472446486, }
  + Physics 2 { type: 1, body: 48947548, landedThisFrame: false, onGround: true, onLadder: false, numFootContacts: 1, leftFootContact.numFlat: 2, rightFootContact.numFlat: 1, numLadderContacts: 0, numLeftEdgeContacts: 2, numRightEdgeContacts: 4, numLeftBlockedContacts: 0, numRightBlockedContacts: 0}
  + Animal 1 { init: true, isWalking: false, direction: 0, decisionTimer: 1.61579, checkGroundTimer: 0.025, isJumping: false, isWhackingRight: false, isAttacking: false, triggerRightArmAttackAnim: false, attackTimer: 0, onGround: true}
  + SpriteDriver 1 { init: true, mode: 1802264951, animating: true, playOnce: false, resetToFirstFrame: false, removeOwnerOnFinishPlaying: false, frame: 0, time: 0.887108, rotation: 0, flipHorizontal: true, flipVertical: false, tint: rgba(255,255,255,255), playbackSpeed: 3.33333, spriteHasFire: false, isProjectile: false, isSpriteOrientable: false, lastSignificantProjectileVelocity: vec2(1,0), isPickupable: false, isAttached: false}
  + Health 2 { health: 6.81482, health_max: 10, blood_colour: 4278190335}
  + Renderable 2 {init: true, layer: MIDDLEGROUND, z: 100, parent: 0, partIndex: 0, children: }
  + Info 1 { description: "a cat"}
  + WorldObject 2 { ... }
  + Flammable 2 { isAlight: false, isAlightForever: false, alightTimer: 0, burnTimer: 0, isFuel: false}
  + Breather 2 { gaspTimer: 0, breath: 5, breathMax: 5, }
Logged

oodavid
Level 8
***


Discombobulate!


View Profile WWW
« Reply #2188 on: January 29, 2014, 01:57:34 AM »

Just been flicking through this thread, there's too much I want to say! Looks lush and good fun. I also like the idea of wearable enemy pelts...
Logged


Button up! - Out on Android and iOS

latest release: 13th March 2015
kcbanner
Level 0
***


View Profile
« Reply #2189 on: January 29, 2014, 06:55:42 AM »

Thanks for posting about your entity component system! I've just finished a similar refactor in my engine where I built a similar system, and am delighted to see that our systems are very similar. I was mostly inspired by the Dungeon Siege entity system, which I found described on an old wiki which is now down (but I have the pages saved if you'd like), as well as Scott Bilas' talks: http://scottbilas.com/games/dungeon-siege/. Thanks for sharing and keep up the awesome work!
Logged

rek
Level 7
**


View Profile
« Reply #2190 on: January 29, 2014, 09:01:04 AM »

Too much code talk, post more gifs! Screamy
Logged
Thecoolestnerdguy
Level 2
**

while(!succeed) try();


View Profile
« Reply #2191 on: January 29, 2014, 10:13:56 AM »

Too much code talk, post more gifs! Screamy

Too much C++ code talk Screamy!
Port Moonman to Javascript, and then we can talk!
Logged

Sad minecraft didnt copyright squares
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2192 on: January 29, 2014, 07:45:55 PM »

@oodavid thx mate Smiley
@kcbanner Yeh that's a great article, and was also my inspiration when I wrote the first bit of MM code over 2 years ago. Smiley

Update: The refactor is done. I've got to tidy up a few things, but thanks for bearing with me with all these technical posts! Here's an image to appease you:




« Last Edit: January 29, 2014, 09:20:50 PM by eigenbom » Logged

Bandreus
Level 3
***


View Profile WWW
« Reply #2193 on: January 30, 2014, 12:01:26 AM »

Too much code talk, post more gifs! Screamy

can't we just have more of both?  Beg
Logged

Zaphos
Level 5
*****



View Profile WWW
« Reply #2194 on: January 30, 2014, 12:23:54 AM »

Update: The refactor is done. I've got to tidy up a few things, but thanks for bearing with me with all these technical posts! Here's an image to appease you:


Hooray!

Also what are those particles?  Is that guy just super smelly?  They look like smelly particles.
Logged

How to Be a Tree | Voro | Realistic Kissing Simulator | twitter | Programmer at Epic Games
rundown
Level 5
*****



View Profile WWW
« Reply #2195 on: January 30, 2014, 08:43:22 AM »

Update: The refactor is done. I've got to tidy up a few things, but thanks for bearing with me with all these technical posts! Here's an image to appease you:


Hooray!

Also what are those particles?  Is that guy just super smelly?  They look like smelly particles.
MoonmanFarts!
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2196 on: January 30, 2014, 05:38:12 PM »

More stuffing around!

Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #2197 on: January 30, 2014, 07:16:02 PM »

http://www.youtube.com/watch?v=TyASwoRF0Qs&feature=youtu.be
Logged

DarkWanderer
Level 3
***



View Profile
« Reply #2198 on: January 30, 2014, 07:20:31 PM »

Blink Wow. These aesthetics have come a long way. I'm in Hand Money LeftKissHand Money Right When & where can you take my money?

Wait, procedural generation, exploration, resource gathering & crafting? Crap Facepalm This should have been on my radar long ago
Logged
_bm
Level 2
**


i'm so confused


View Profile WWW
« Reply #2199 on: January 30, 2014, 07:24:57 PM »

Those flame particles are amazing!  Crazy
Logged

Pages: 1 ... 108 109 [110] 111 112 ... 189
Print
Jump to:  

Theme orange-lt created by panic