Jump to content

Lunarovich

Members
  • Posts

    166
  • Joined

  • Last visited

Everything posted by Lunarovich

  1. It works. Thanks! IMHO, this should be done in an automatic fashion by LE or Blender LE exporter.
  2. Every time that I try to import a model from Blender, LE treats it as if it were smoothly shaded. This happens when I do as well when I do not set explicitely shading to flat in Blender. Here is how it looks in Blender: And here is how it looks in LE: Is there a way to get a flat shading when importing from Blender? Thanx!
  3. Hello! I would like to change the default/minimal size of the grid cell so that it does not snap in multiples of 4. Is it possible to have a custom grid cell size so that I can snap objects in multiples of, say, 5? P.S. I know about Increase/Decrease Grid Size options (triggered with [ ]) and I know that I can reduce the grid cell size to 1 or turn off the grid snapping in order to achieve an arbitrary placement of entites.
  4. When I've started, I first did . While doing the series, you should keep open the official guide page as well as the official documentation page and consult it when need be. If you do not know anything about Lua, but know the programming, check first two tutorials on Lua on the official tutorials' page suggested by Josh and, eventually, give a go to the first chapter of the Programming in Lua. And if you are completely new to programming, then you'll have to find some good Lua starter book for non-programmers or at least a decent and comprehensive tutorial. Although the official site probably does not lack any information that you will ever need, you'll have to know exactly what you are looking for and where to find it (approximately ). LE is a very intuitive and elegant framework, and easy to use (at least easier than any other engine I've used so far, and I've tested every major 3D framework), but you'll have to learn the basics of 3D math and basics of LE first. A decent LE getting started guide (with 3D math simplifications maybe and a comprehensive Lua tutorial), official or not official, does not exist yet and, I think, that it would be more than welcome.
  5. I've been working for two days now. I have a basic voxel & chunk generating functions. Voxels are generated with invisible sides occluded. I still haven't implemented invisible chunks occlusion, but would consider my work basically done (for my intents and purposes) when I do it. Namely, from what I've done so far, I've concluded that the number of surfaces is far more important than the number of vertices performancewise. That is, the surface number impacts the performance in a lot more significant way than the number of vertices. Here are facts (relative to my architecture) that lead me to that conclusion. - With a chunk of 64 voxels per chunk dimension, you can easily have over 2 million of voxels with 60fps. - With a chunk size of 16, you can still get away with over million of voxels and get a 60fps. - With a chunk size of 8, you cannot go over 300 thousand and have a 60fps. The problem is that a larger chunk requires a longer time to rebuild. A chunk of size 16 already makes the game visibly stutter for a fraction of a second if you move your character/camera and destroy voxels (I'm destroying them with a single mouse click instantly). The chunk of size 8 gives a barely visible split second stutter on a voxel destruction/rebuild, but suppose that's OK for a normal block building game. So, as I've said, there is directly proportional relation of chunk size and number of chunks you can have in your game. The downside is that there is also a direct proportion between the chunk size and chunk rebuild time. But to get to the point, chunk occlusion algorithm is far more important than vertices collapsing algortihm for flat chunk surfaces, because the performance impact of the number of surfaces is greater than that of the number of vertices. P.S. I'm doing the chunk (re)building in Lua. Maybe a C++ would give better results. (I have a standard edition, but do not feel comfortable yet with C++). P.S. Will send a commented code version as soon as I finish. Or commented version of what I've done so far if I change my mind on the way I'll implement my physics puzzler block manipulation game. P.S. Thanks for the glasses A wayfarer model - my brother, who does the photography, took this photo of me in front of the Zurich lake.
  6. I see that I can Surface::AddVertex. Is there a way to remove a vertex from a sruface or I have to rebuild it from scratch every time I want to remova a vertex? I'm asking it because I'm trying to implement some voxel manipulation framework. At the moment, I rebuild a whole chunk when a single voxel is removed. Is it the only way to do it? Thanks!
  7. Thanks. I knew it was the sci notation, but was puzzled by the fact that other sides that where axis aligned gave int results. What confused me here were leading zeros after the - sign, so I did not know if the number is very small or very large . Thought that we use only signifcant digits. Anyway, thanks again!
  8. Thanks. I did as you suggested. Here are the screenshots: I am printing values with local pos = pickinfo.position System:Print(pos.x .. " " .. pos.y .. " " .. pos.z) directly under the camera pick test.
  9. I'm implementing a camera picking with this code if (window:MouseHit(1)) then local pickinfo = PickInfo() if (self.camera:Pick(context:GetWidth() / 2, context:GetHeight() / 2, pickinfo, 0, true)) then System:Print(pickinfo.position.z) end end and I'm getting really wierd results concerning the pickinfo.position.z (x and y are correct). Here they are This happens only when I'm picking the cube (CSG, but happens with models as well) from the frontside, that is, when I'm facing in the positive z axis direction. When I slowly move the mouse and do the picking, I get different results (already impossible, since the cube side is aligned with the x axis) with impossible values... EDIT: It seems that it happens only when the side of the cube is aligned with the x = 0. Could it be a bug?
  10. OK, thanx. Although it's simple, it would be nice to have this functionality out of the box.
  11. Thanks macklebee. And thanx everyone for all the explanations. Seems quite clearer now
  12. @CreativeOcclusion, thanx! But I was talking rather about folder name and the name in the project manager... Is there a way to change it? 'Cause I don't see any option in the project manager to rename a project and I suppose that I cannot simply change the name of the folder...
  13. I know that it's a stupid question, but is there a way to change a project name in Leadwerks? Some automated way that changes all relevant filenames from the root folder? Or can I just change the name of the executable?
  14. Thank you for the answer. However, the fact that I can get more or less better results does not confort me. I expect it to be either a collision with a named entity or no collision at all. I know that I can check if entity ~= nil, but is there a more elegant way that always gives me intended results?
  15. Hello, can anyone give me a hint or a link that explains how to create Lua classes similar to those built into Leadwerks? For example, Leadwerks has a Model class, and you can do a Model:Create() in order to create a new model. I would like to have my custom classes, eg. Block, with a method Block:Create(). I know that Lua classes are, in fact, made in C++ and disposed via Lua interface. I have a Leadwerks standard edition, but would prefer not to fiddle at this point with C++ (which I've, BTW, learned, so I can use it). But if it's necessary, I would gladly ask for some hint/advice where to start. Thanks in advance!
  16. Hello! I think I understand the meaning and use of other blend modes (solid, alpha, light and invisible). But what are blend modes shader and mod2x and when do we use them. BTW, the relevant command reference page should add Blend::Invisible to the current list of Blend types.
  17. When the player first hits the "Death trigger" (which is Collision.Trigger), the Entity:GetKeyValue("name") outputs a correct value, ie. "Death Trigger, however, player's speed is 0 for some reason in that and a subsequent tick... Then player gets teleported (via SetPosition) to the respawn point. In the meantime, its speed is about 25 as it should have been when he hits the trigger... Since now the player collides with a normal ground and not a trigger, he dies. Why would the speed be 0 when he hits a trigger? And how comes that an Entity:GetKeyValue("name") is an empty string in all subsequent ticks when a Script:Collision gets called? I mean, aren't we supposed to always collide with an entity and doesn't all entities have names? EDIT: It seems to me that I have a general problem with the Entity:GetKeyValue("name"). I've pinned the problem down to the fact that entity:GetKeyValue("name") sometimes returns an empty string inside the Script:Collision, which I don't understand, as I've explained in the previous paragraph.
  18. Admittedly bad semantics. It's not supposed to be a death trigger. It's a spawn trigger. So, I wouldn't like to get killed when hitting it hard So ~= should stay. Anyway, this is not something that puzzles me. It's a suite of behaviors described in EDITs of post 3.
  19. Thanks! When I try it, the System:Print outputs a correct value, ie. Death Trigger, to the console, but the code still doesn't work. Anyway, why do I have to use tostring function. Isn't Entity:GetKeyValue supposed to give me the value that I'm looking for, ie. of type string? EDIT: I've just checked with the type(entity:GetKeyValue("name")) and it does give me a string... This one puzzles me... EDIT: OK, this one, for some reason, works: local name = entity:GetKeyValue("name") System:Print(name) However, this one still does not work if speed>20 and name ~= "Death Trigger" then self:Hurt(100) end even though the name gets the correct value, ie. "Death Trigger" outside the if condition. Inside the if condition, name seems to be an empty string... How strange... At least for me Am I missing something about Lua lexical scoping??? EDIT: It seems that I am trying to call a GetKeyValue on a non-existing entity. Not yet sure, though.
  20. Hello, this one is "hurting" me Here is an error message that referes to the System:Print() call: error in function 'Print'.; argument #3 is 'string'; '[no object]' expected. function Script:Collision(entity,position,normal,speed) System:Print(entity:GetKeyValue("name")) if speed>20 and entity:GetKeyValue("name") ~= "Death Trigger" then self:Hurt(100) end end Also, the condition in the third line does not work, although I have an object that is called "Death Trigger" and the script gets activated when I hit it... BTW, don't know what is a third argument of the Print. Also, what does the "'[no object]' expected" means?
  21. Thanks! Is a static scene geometry, as you've said, an object of its own kind or is it a static model, ie. a rigid body entitiy with a mass 0? I mean, I know I'm pestering a bit with this question, but no one seems to give me the final answer...
  22. I was going through this and he says that you need to give non-zero mass or attach a script to the CSG object in order to turn it into entity. Concerning what Josh have said, maybe he should have added, an entity with a separate surface, since large models made out of CSG are geometries turned into entities silently by Leadwerks, as I believe. P.S. Maybe I'm overdoing it, but it's just my cartesian need to have a clear and distinct understanding of the subject matter
  23. I've already corrected/edited the post #5 and said in post #9 that adding scripts to same instances of models do not make models have separate materials. So, their behavior is expected and explained (which puts my mind at ease). However, the question remains in respect to CSG. Why does adding scripts works in the case of objects made using brushes? And why random group of these objects react in the same manner - get / do not get the assigned material - on material change (via mouse picking, which is inessential here)? Does it stem from the fact that Leadwerks converts CSG objects with scripts, under the hood and in the runtime / on the map creation, into separate models, ie. models with separate surfaces?
×
×
  • Create New...