Page 8 of 9

Re: Dungeon Editor Suggestions

Posted: Wed Apr 02, 2014 3:38 pm
by Leki
Hi guys, maybe I missed it and it's already suported/you know about it, but for sure - may I ask you for support of in script questions to get information about environment?
Smth like:
IsFloor(level, x, y) - will return true/false
getFloorType(level, x, y) - will return floor object
(hope new walls are definted as objects with names and components like animations etc, old wallset definition is really outdated)

and the same for walls:
isWall(level, x, y, dir) - willreturn true/false
getWallType(level, x, y, dir) - will return wall object id

or simple return interator with cell info, smth like
getCellStructureInfo (level, x, y) will return, floor, walls and ceiling (false or used object)

Well, I'm sure you know what I mean... :roll:

Re: Dungeon Editor Suggestions

Posted: Thu Apr 03, 2014 9:41 am
by antti
We've gotten rid of the old wallsets and now we instead use a system based on tiles. Basically we've got different brushes for laying down floors and walls and you can mix and match different tiles within the same level. The tile definitions define what kinds of objects are placed as the floors/walls/ceiling/pillars etc. in each tile and these will be actual full blown objects so that they can use all the components other objects use and they can also be manipulated with script at runtime if needed.

We've got an isWall function which, when you reverse the result, is basically what you would get from an isFloor as well. We've also got isBlocked, isPit and isObstacle. We don't have a getFloorType-function since once the tile has placed the floor object into the level it's just an object like everything else and there's nothing that really makes it a floor specifically. But hey, since it's just a good ol' object, you can just use entitiesAt to find the floor/walls/ceiling 8-)

Re: Dungeon Editor Suggestions

Posted: Thu Apr 03, 2014 11:51 pm
by Leki
antti wrote:We've gotten rid of the old wallsets and now we instead use a system based on tiles. Basically we've got different brushes for laying down floors and walls and you can mix and match different tiles within the same level. The tile definitions define what kinds of objects are placed as the floors/walls/ceiling/pillars etc. in each tile and these will be actual full blown objects so that they can use all the components other objects use and they can also be manipulated with script at runtime if needed.

We've got an isWall function which, when you reverse the result, is basically what you would get from an isFloor as well. We've also got isBlocked, isPit and isObstacle. We don't have a getFloorType-function since once the tile has placed the floor object into the level it's just an object like everything else and there's nothing that really makes it a floor specifically. But hey, since it's just a good ol' object, you can just use entitiesAt to find the floor/walls/ceiling 8-)
Thanks for info antti. Yes, I know about brushes and "wallset mixing in one floor" etc. It's great improvement.
Will we be able to work with classes? As "Floor" or "Wall" etc?
e.g.:

Code: Select all

local checkedCell = entitiesAt(level, x, y)
      for object in checkedCell do
         if object.class == "Floor" then
            if.object.name == "standard_floor" then
              do smth
            else
             do smth
            end
         end
       end
In other word, I'm thinking about multibrain AI - different behaviours, each as component - activated, deactivated on fly. I have some idea about multicell monsters and I wenna "read"
their surroundings. So it will turn left right if there is space for that - usually pivot will stay in "main cell" etc.
Another example of that is "custom minimap" - onGui cycle will track few cells around the party - You know, I have some sci-fi mod idea and atm I play withsome "aliens like movement detector" - and I wanna see walls etc on that gadget... Another think is, that there can be some kind of dependence on scanner level, mapmaking skill level etc, so "minimap can be" draw in different "quality levels" - with or without secret doors etc... [/color]

Re: Dungeon Editor Suggestions

Posted: Fri Apr 04, 2014 9:45 am
by antti
Leki wrote:Will we be able to work with classes? As "Floor" or "Wall" etc?
As a concept, objects themselves having classes doesn't really fit anymore into what we have now since the objects are now just a collection of components. For these cases, it might just be best see if you can detect the type of object you're looking for from its components and the properties of the components. For example, the item component has a traits-property which can be very useful when trying to detect an item that fits to a broad category such as "light_armor", "potion" or "axe".
Leki wrote:In other word, I'm thinking about multibrain AI - different behaviours, each as component - activated, deactivated on fly. I have some idea about multicell monsters and I wenna "read" their surroundings. So it will turn left right if there is space for that - usually pivot will stay in "main cell" etc.
If I understood correctly what you're aiming for here, all you would need is isBlocked, and isObstacle. There's no need to use object detection here since after all the floor assets themselves contain no functionality at all since they just have a mesh for visuals and could even provide misleading information: a cell with a floor on it could still be blocked by, say, an altar or a monster. Of course if you want to have different behaviors on different floor types, yeah, then you might need to detect the floor objects in addition to isBlocked and isObstacle, but for general movement it should be unnecessary.
Leki wrote:Another example of that is "custom minimap" - onGui cycle will track few cells around the party - You know, I have some sci-fi mod idea and atm I play withsome "aliens like movement detector" - and I wanna see walls etc on that gadget... Another think is, that there can be some kind of dependence on scanner level, mapmaking skill level etc, so "minimap can be" draw in different "quality levels" - with or without secret doors etc...
Cool idea! For this, I'd start off with isWall and isObstacle for getting the level layout and then fill in the rest (monsters, doors, secret doors, items etc.) by checking out if the objects can be detected via their components: monsters always have a monster component, items have item, doors have door etc. Separating secret doors from normal doors is more tricky though and there I would probably use getDoorSound to detect if a door is supposed to be secret or not.

Re: Dungeon Editor Suggestions

Posted: Fri Apr 04, 2014 3:43 pm
by Isaac
antti wrote:
Leki wrote:Another example of that is "custom minimap" - onGui cycle will track few cells around the party - You know, I have some sci-fi mod idea and atm I play withsome "aliens like movement detector" - and I wanna see walls etc on that gadget... Another think is, that there can be some kind of dependence on scanner level, mapmaking skill level etc, so "minimap can be" draw in different "quality levels" - with or without secret doors etc...
Cool idea! For this, I'd start off with isWall and isObstacle for getting the level layout and then fill in the rest (monsters, doors, secret doors, items etc.) by checking out if the objects can be detected via their components: monsters always have a monster component, items have item, doors have door etc. Separating secret doors from normal doors is more tricky though and there I would probably use getDoorSound to detect if a door is supposed to be secret or not.
Is there any chance that the modder can define custom data [properties] in an object? In effect, (among many other possibilities) they could label a custom door as a "secret" door in a property, and check for that property in their scripts.

Re: Dungeon Editor Suggestions

Posted: Fri Apr 04, 2014 6:55 pm
by petri
Isaac wrote:Is there any chance that the modder can define custom data [properties] in an object? In effect, (among many other possibilities) they could label a custom door as a "secret" door in a property, and check for that property in their scripts.
I agree this would be very handy for modding. At the moment it's possible to mark objects by adding a NullComponent to them and give the component a descriptive name, e.g. "secretDoor" but this is somewhat limited because you can't define arbitrary properties this way easily.

However, it should be possible, and hopefully even relatively easy to give mods full access to object definitions. If this feature doesn't make it to the first release, it should be quite easy to patch it in in another "Petri codes and consumes unhealthy amount of Glögg" session :)

Hmmm, now I'm wondering would it make sense to have an open mod feature request / coding session before the release…?

Re: Dungeon Editor Suggestions

Posted: Fri Apr 04, 2014 8:01 pm
by Isaac
petri wrote:Hmmm, now I'm wondering would it make sense to have an open mod feature request / coding session before the release...?
Several modders would certainly weigh in with past experience, and what they wished they could have done; or had access to.

I would have liked the ability to add:
myVar1 = "foo"
myVar2 = {"foo"}
myVar3 = function() ... end
To any defined object and have it accessible with
myObject.myVar1
myObject.myVar2[x]
myObject.myvar3()

With that I could [possibly] define a container that only accepted keys (and looked like a ring); and when used on a lock, could be asked if it had the right key to open the lock.

*This was an off the top [hasty] example; I'm sure it could be done with existing script methods. ;)

Re: Dungeon Editor Suggestions

Posted: Sun Apr 06, 2014 2:29 pm
by JohnWordsworth
@Petri: It would be very exciting if you had a Glögg fuelled coding session for the dungeon editor before release! Although, there might be the problem that we spend the time asking for features that you've already added by naturally upgrading for your own purposes.

If it would be of any help, I can compile all of the ideas from this thread and around the forums into the first post of this thread (which contains most of the features I would request during a coding session at the moment). Note that the idea of having custom properties or 'user data' on entities is already there :p.

Re: Dungeon Editor Suggestions

Posted: Sun Apr 06, 2014 10:12 pm
by Asteroth
JohnWordsworth wrote:@Petri: It would be very exciting if you had a Glögg fuelled coding session for the dungeon editor before release! Although, there might be the problem that we spend the time asking for features that you've already added by naturally upgrading for your own purposes.

If it would be of any help, I can compile all of the ideas from this thread and around the forums into the first post of this thread (which contains most of the features I would request during a coding session at the moment). Note that the idea of having custom properties or 'user data' on entities is already there :p.
Yeah, I think most people would just be stabbing blind wondering if the feature they're asking for is even relevant with how it's setup. The whole affair would be clumsier than a sober petri.

Re: Dungeon Editor Suggestions

Posted: Mon Apr 07, 2014 1:30 pm
by Leki
Thanks for answers, guys!
Yes, I have some ideas how to extend monsters movement to make some extended tactic experience in combats - like worm moving in mud (under floor, jumping out only for attack = hard to kill) and stone floors (moving on the floor, so easy to kill) where you must lure him - so I need to "read" environment around monster to switch into new anim set etc.