Jump to content
The Dark Mod Forums

Announcement: SEED system


Tels

Recommended Posts

SEED

 

System for

Environmental

Entity

Distribution

 

There were no other suggestions, or objections, so I have bitten the bullet and renamed the source code files now. Spawnargs and entity def doc will follow in a few hours.

 

Maybe somebody else has the time and go through the wiki article:

 

* http://wiki.thedarkmod.com/index.php?title=SEED

* http://wiki.thedarkmod.com/index.php?title=SEED_-_Spawnargs

 

and change all occurances of "LODE" and "lode" with "SEED" and "seed"? Be careful not to change "LOD", tho.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Hey!

 

Start discussing (debating, fighting, etc) the challenges of getting this working again!

 

:wub:

 

My popcorn is getting cold. :laugh:

 

(Unless everything is now understood as far as possible without trial... Then I'll let you get back to work. :) )

 

Thanks!

The Peanut Gallery

 

(PS. Moar pics and stats please! :D ) :wub:

 

 

(Edit: Wow psychic! )

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Already starting! :D

 

Wow, I guess our edit streams crossed :D I renamed the articles already, so all that is left is the spawnargs article, but I leave that to you.

 

Both the source code and all the spawnargs have already been renamed, so the new name should be in effect now :)

 

Now I can now look into fixing a few bugs, optimizing it and implement a few more placement strategies (depending on surface angle would be nice to have...)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I've started tracking the remaining bugs on the tracker:

 

#2569 - SEED: func_statics are invisible when combine=0 Fixed, as well as issue like wrong size (if scaling wanted), wrong clipmodel, and wrong size again if func_static with model, but combine = 0

#2570 - SEED: segfault (crash) when you use combine=0 with func_statics from map geometry Fixed.

#2571 - SEED: Restore() crashes when you use combine=1

 

and begun fixing them.

 

The Restore() crash is actually not as bad as thought, it only happens when you combine entities, e.g. the basic SEED code Save()/Restore() seem to work, it is only CStaticMulti() that crashes, and possible already crashes upon DESTROY (e.g. before it even comes to Restore()). So this should be easier to find.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Fixed 2570 (the ModelGenerator access the scale without checking if it is NULL), but the func_statics build from map geometry are still invisible and have the wrong model. Tracked:

 

#2572 - SEED: combine=0 and map-geometry func_statics are invisible and have wrong clipmodel Edit: And fixed, was easier than I thought.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Found a few others bugs:

 

* Not yet fixed: 2575 Regarding attached/bound entities (attached/bound via DR, it should work fine it these are attached via the entity def) - SEED does not take these into account, so if you try to use it to clone an entity with some attachment, the attachment is lost. Even when such entities are not combined, respawning the entity loses the attachments/targets). Also, we need to decide if we clone the targets, too, or if all clones share a link to the same target.

 

* Not yet fixed: 2576 Same same goes for bound entities.

 

* Not yet fixed: 2578 Entities like Actors, Lights or Moveables where never combined, but it didn't occur to me that f.i. our combined light entities are not lights, but simple func_static with 1 or more attachements and a script object. And combining entities with script objects cannot work, so I disabled it. Proof: randomly spawned oil_lamp_standing_lit (you see they are not exactly upright, because the default is rotation around Z with +-5°): (ignore FPS, they are not accurate. I get solid 60 here)

 

post-144-129587507581_thumb.jpg

 

Spoke too soon, there are other things that cannot be combined, see #2578 for details. F.i. particles, movers, and so on. Working on it.

 

* Not yet fixed: 2579 Copy important spawnargs. For instance cloning of a rotating door might lose the "rotation" spawnarg, breaking the door. This is a general problem with all sorts of spawnargs that the mapper can set on the entity in DR before the SEED sees it

 

* Fixed already: combine = 0 with func_statics with a model did not scale them (only func_statics made from brushes/patches geometry where scaled)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I have implemented an ImageMapManager, which fixes #2573.

 

Formerly, if you used an image-map based falloff, the SEED entity would load the image and store it. It did so, however, for each entity class. And if you had multiple SEED entities, they all would load the same image.

 

So if you had a SEED with 2 classes using the same image, and then duplicated it 10 times, you'd end up with 20 copies of the same data.

 

This led to a lot of unnec. file loading/image decompression/density calculation, as well as duplicate storage of the image maps. A 1024x1024 greyscale image uses 1 Mbyte for the image data alone, that does not count overhead for the management and the CImage class needed to access it.

 

Now the image map manager loads the image only once, all other accesses afterwards just get the same data back. Each additional usage of an image needs now only 4 bytes (integer index).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Some more work done:

 

* added a new image map called "splat":

 

post-144-129623031437_thumb.png

 

* found out that if you have three classes with density 1, 2 and 3, and the SEED wants to generate 600 entities, you didn't get 100 for class #1, 200 for class #2 and 300 for class #3, but instead got 200 for each class. Oops. Tracked #2586 and fixed it.

* Tracked: #2584 - the pre-made entities did not say on which surface type they want to spawn, leading to f.i. grass growing on metal or stone. Fixed most of it, too. (The bug is not yet resolved as I want to add more pre-made entities first)

 

Here is a screenshot showing the work of the last days:

 

You can see that the grass has more models than the heath, and that both heath and grass grow differently dense depending on the image map, but also on the underlying surface: almost no grass and no heath at all on gravel (center), a bit of both on mud (right) and many more on dirt (left). Also none grow on the metal stripe or the stone barrier.

 

post-144-12962306505_thumb.jpg

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Cool stuff Tels. I can't believe how many features you are adding in such a short time-frame.

 

I see that you've eliminated the restore crashes, but have some "side-effects"...

 

Care to share a screen or two of those quirks for posterity?

 

:)

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Cool stuff Tels. I can't believe how many features you are adding in such a short time-frame.

 

I am actually trying to fix bugs first and keep the new features for after v1.04, because it needs "to work" for mappers to try it. One completed feature is better than 3 only-80% working ones...

 

I see that you've eliminated the restore crashes, but have some "side-effects"...

Care to share a screen or two of those quirks for posterity?

 

:)

 

Well, there isn't much to see, "combined render entities" are a small black box, and "smoke emitters" (which are invisible before the save for some reason) are suddenly emitting smoke after restore (that effect still baffles me :)

 

Edit: Remembered I did make a screenshot already:

 

post-144-129629677256_thumb.jpg

 

Black boxes: missing render models of CStaticMulti entities. Smoke: Appeared. The brittlefracture (the glass thingy), the rotating doors (metal thingies) and the particle emitters (white snow flakes) and lights (torches) all appear to work just fine after restore.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

What happens if you perform "reloadDecls" while SEED is active?

 

Did you try that after seeing the above behavior? :unsure:

 

No, haven't done this, and I am not sure it would help. The "missing rendermodels" are dynamically created, anyway. It is probably just a small bug somewhere that the recreation is not properly triggered.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I have now checked in a first stab at making the "watch over entities" (#2590) work.

 

It works now for entities-with-spawnclass (e.g. anything you create with "Create entity" in DR) as well as func_static with a model (e.g. anything you create with "Create model" in DR).

 

This also includes treaing the entities we watch over as sep. from the entities we randomly genereate, so a menu setting change does not destroy the watched-over entities wrongly.

 

The remaining issue is now watching over func_statics build map geometry (e.g. anything you create with "Create func_static" in DR). The reason this does not work yet is because the ModelGenerator has not yet a call to combine arbitrary models together (e.g. append one model to an already existing model), it always only create a combined model from a list of (equally) models. That can surely be fixed, but needs more work in the ModelGenerator first. Plus, since you can already combine such entities in DR, there is no pressing need to get it to work ASAP :)

 

Anyway, I have written an wiki article why you want this feature:

 

http://wiki.thedarkmod.com/index.php?title=SEED_-_Watching_entities

 

There is now also an article explaining drawcalls:

 

http://wiki.thedarkmod.com/index.php?title=Drawcalls

 

Here is the key difference between what we had before and what we have now with SEED:

 

post-144-129640447037_thumb.jpg post-144-129640471815_thumb.jpg

 

You can see that afterwards there are only two entities instead of 5 (ignore the missing banner far-away, I did make the screenshot before adding it to the map).

 

Edit: Is anyone bothered by the spawnarg name "seed_watch_brethren"? I find it is quite long, but "seed_watch" does not conbey that this means it will watch over *all* entities in the same class/category inside itself...

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Hm, I think I hit a snag, here are before and after images from a part of Johannes' map:

 

post-144-129640690522_thumb.jpg

post-144-129640688745_thumb.jpg

 

Pay no attention to the FPS; they are spurious due to the screenshot taking.

 

(Edit: Accidentily swapped the images, the brighter one is after. And fiddling with the normals shows that basially the created normals on the created model are wrong but I haven't found out to create them correctly so far.).

 

The after image contains two automatically created entities of ivy, the before has over 70 individual entities. They should be identical, but instead show a clear difference in lighting. :(

 

Can someone imagine what the difference is that my code creates?

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

What happens if you manually place a stock ivy plant in the scene?

 

(Did Johannes play with the material definitions or textures to get that look? )

 

I like the FPS boost :)

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

What happens if you manually place a stock ivy plant in the scene?

 

(Did Johannes play with the material definitions or textures to get that look? )

 

I like the FPS boost smile.gif

 

Nope i didnt...but this are 3d vegetationparts...so different lightreflection and shadows...

are the generated ones also 3d Tels?

Link to comment
Share on other sites

What happens if you manually place a stock ivy plant in the scene?

 

I did not modify the map except:

 

* add one SEED that spans the entire scene

* link the SEED to one of the ivy plants

 

The rest is done automatically, at map start the SEED finds all ivy plants (basically all entities that are either the "same class", or "func_static" + "the same model") and combines them. Interestingly enough, Johannes did use one ivy with a skin named "darker_ivy", which causes the seed to combine all ivy plants into two entities: one with 72 ivy models and one with 1 ivy model :) (took me an hour debugging to find out that this is supposed to happen and not a bug in my code :)

 

So, placing a model "manually" in the map is exactly what was done :)

 

(Did Johannes play with the material definitions or textures to get that look? )

 

No, he just placed 73 copies of the same model in the map.

 

I like the FPS boost :)

 

Remind me to remove the FPS from any screenshots I post, because they are irrelevant - not only do fluctuate the FPS in the scene on my system wildly (40..60 FPS) but they are also very high to begin with. The only difference this will make is in the number of drawcalls, so people with less beefy systems will see improvements.

 

Here are the numbers before/after:

 

drawcalls   tris   shadow tris   
569        41100          9614
216        49603          9614

 

Not sure why it are a few more tris, maybe because the ivy that is outside the screen is no longer clipped away. That proves that combining everything blindly is still not a good idea. However, 50K vs 40K tris still render much faster when they are done in only half the drawcalls :)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Nope i didnt...but this are 3d vegetationparts...so different lightreflection and shadows...

are the generated ones also 3d Tels?

 

Yes, they are exact clones/copies. The appear different (in the light) because the Modelgenerator garbles the normals during the copy operation. I worked on a fix (with the help of rebb), but it is not 100% proper yet.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

:D

 

Viva la v1.04!

 

Not so fast, because it does unfortunately not work :/ The case I have has no scaling, and if you look at the new rotation code for the normal, it is just the same code I had - and that doesn't work. Just tested it, ends up with the same superbright ivy :(

 

But at least the scaling code looks better than my version and also I really should put the scaling into a different branch because often we don't scale anything, anyway. So, thanx stgatilov, I put your code in, lets see if we can deduce what goes wrong with the normals.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recent Status Updates

    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
×
×
  • Create New...