Jump to content

Phodex Games

Members
  • Posts

    275
  • Joined

  • Last visited

Everything posted by Phodex Games

  1. Hi, recently I am working on some new animations for my FPS hands. The problem I have is I have for example a sword attack animation, and want the player to be able to equip diffrent weapons (types of swords). I kind of worked out a solution which works, but I causes a lot of trouble and is not much fun to work with and I cannot believe there is no better solution. I simply put a weapon bone into my rig, then I imported the sword model inside Blender, parented it to the bone to see the sword while animating. Then I export the rig an hand model, afterwards I export the Sword model (in its original position and rotation of course), but if I parent it to the weapon bone, its rotation is weird and I need to manually fix it, or I can't even find the right rotation. I tried fbx export, and leadwerks exporter. I get very diffrent results. I tested this stuff for hours now and are kind of frustrated :(. So far to what I already did. Now my question: What is a common way to do such a thing, as I dont know? Any tutorials, guides how to realise a system like this? How do you guys solve that? Because it is really a pain to syncronize the positions/rotations I have inside Blender, with the Leadwerks dimensions. Thank you in advance for your answers.
  2. Introduction Hi, last time I gave you a rough idea of what the Phodex Framework is and what plans I have. This time I will talk about what I am working on at the moment and what my plans for future are. So this is kind of the first real blog entry :). What I am working on? Recently, beside some bugfixing and improving stuff, I tweaked all imported models (collapsing, normal calculation), set up the materials so that they fit the look I want etc. I also reorganzied my folderstructure within the project, and came up with a pretty cool tag system (by renaming my objects) for beeing able to quickly find what I need inside Leadwerks. Maybe I will introduce it any time soon :). More recently I rebuild the whole city, shown in the Introduction of the framework. This was needed, as I collapsed most of the models, so it was kind of a mess after my cleanup :D. But I did not only rebuild it exactly as before, I tried to make the city more interesting and did some tweaks here and there: What is next? The next big thing on my to do list is recreating/tweaking all first person animations, as those I have at the moment are just kind of placeholders and look pretty aweful. In total that are about 40 animations, so I guess I will be pretty busy :D. After that, I will create some armor for the player an also create new NPC animations to fit my combat system. What is the plan? As many features I want inside the framework are already there, my plan is to create a test scene, with a more or less livley city, where you can get some quests, buy from a trader, figth some monsters, hire a mercenary and talk to some townfolks. This will easily show me where I need to improve, or where stuff is missing. Another nice thing is that I can then make this level available for you to play, so you can take a look on what is possible with the framework, of what quality it is and of course can give better feedback. Conclusion First thank you for commenting, last time, feel free to do this at any time :). I am always glad to hear ideas and suggestions as well as what you would wish the framework would provide. Thank you for reading and stay cool Markus from Phodex
  3. Du bist der erste Deutsche den ich hier antreffe werde mir dein Projekt, demnächst mal ansehen. Immer weiter so sieht schon mal nicht schlecht aus.
  4. Hi @Marcousik, thank you for commenting. You are very true, this a really interesting question, I haven't answered in this post, but I am aware of it. That is why one of the keywords of the Framework is "accessibility". I guess I best explain the idea with a specific example. My AI script offers the "user" to chose how the AI behaves in combat. Lets take melee combat for example. You can chose out of 3 block types (No blocking, block only on demand (parry), constant blocking (e.g with a shield)). You can chose if the AI uses one static weapon, or if it is able to pick up weapon items and equip them. You can even decide if the NPC uses combo attacks (instead of single hit attacks), if he uses spells or powerattacks. This is just a small example for one thing inside the framework. So to sum up, I always try to offer a varitey of designs and functionalities (I take a look at a lot of games and chose the best and most common systems) the user can chose from and at the same time, I try to offer as much settings and costumize options as possible to allow the user altering the style without needing to mess around with heavy coding. I achieve this, by using prefab systems, so you can either use the prefabs provided with the Phodex Framework or easily create your own. Furthermore, you can even adjust some more basic settings within the prefabs themself. I hope this was not to confusing. What I can say to conclude, is that you best wait until I can show the systems behind the framework and then comment again, it is a little hard to imagine everything I explained here and my ideas at all ^^. The only thing which is important is that I am aware of what you where saying and that is the biggest challenge with the Phodex Framework.
  5. Very interesting indeed, thank you for that. I guess I can build up on that.
  6. Hey, I am currently working on my AI, and I wonder what would be a good way, to make my NPC hold a specific distance to the player. In my case I need it for my AI behavior when it is using range weapons. I think a nice idea is to let the AI find a random point, which keeps a few conditions like, 10 units away from player, not outside of the map, not inside another object. But how to realise that. I would be very thankful if you can give me ideas, examples, descriptions etc.
  7. If you want to, I could explain this to you more detailed in out next "lesson" ^^, but yes it pretty much works like you explain it. It can be a little bit confusing to make the weapon/item appear correctly inside the characters hands. You need to take care when setting the origin of the weapon. This can get more difficult, when working on a range weapon, especially when you visually see the projectile (e.g a bow/crossbow).
  8. That sounds fair I guess, if you can choose between subscription or one-time purchase. I am pretty excited to see LE 5
  9. @Marcousik Okey I guess I understand now what you mean, thank you for that. But I am searching for a solution, where my player model does not have every cloth available attached to it, because I think its not that smart. Or is this how that kind of stuff works normally, I have no idea. I think this method should work for me, still it would be cool, to be able to have all the cloths as seperate entites inside Leadewerks and attach them to a rig inside leadwerks (like you would do inside your modelling software). Thats actually was what I am asking for, IF there is a way to tell Leadwerks, to use a specific rig for an yet unrigged model. Actually, it does work if you put an entity to an BONE inside an rig, this object moves with the animation, but it does not work for multiple bones. Edit: So again thank you for this idea, after thinking about it I guess its a pretty good solution, although not 100 % perfect.
  10. @Marcousik Ok but how to hide the cloth now, and what if I dont want my model to have the cloths attached to them all the time. I am searching for a functionality to "merge" my cloth model to the players rig, so that it follows its bones, this should be possible somehow shouldnt it?
  11. Hmm weird, maybe the textbox is getting enabled somewhere else, because thats what it looks like. Try to print something inside your postrender function where the textbox is getting rendered, to see if its getting called.
  12. Haven't you tried my timer code? There is no built in timer function or something like that. Try that out: Script.timer = 0 Script.widgetLifeTime = 30 function Script:UpdateWorld() if self.enabled then --This is the timer: self.timer = self.timer + Time:GetSpeed() if self.timer >= self.widgetLifeTime then self.timer = 0 self:Disable() end end end You need any function which updates every frame and put that timer code in there. Do NOT put this lines of code into a function which just gets called once. You can for example put this inside the post render function. The "Time:Delay" function freezes your code for a specific amount of time I guess.
  13. Yeah I know, thats why I said its a stupid answer ^^, especially because you knew that already didn't you :P. But don't you have a website maybe? You can make a password saved area there where you upload the newester version or something like that? I gues thats a more smart solution.
  14. I personally use my own UI system, so I am not much into the Leadwerks built in UI system, but I can help you with the stopping after a specific time. As far as I understand it you want the message just be displayed for a specific of time don't you? For this simple add a timer, which disables the widget like this: Script.timer = 0 Script.widgetLifeTime = 30 function Script:UpdateWorld() if self.enabled then self.timer = self.timer + Time:GetSpeed() if self.timer >= self.widgetLifeTime then self.timer = 0 self:Disable() end end end But your disable function won't work. I guess you have to release the widget somewhere, but at them moment I dont know how this exactly works with the leadwerks UI, maybe check the Reference for that. I don't get what you mean with:
  15. Hi, I have not solved this problem, yet, although I have it for quiet a while. I want to make a system so a character can wear diffrent clothing. Say I have an Character which I want to wear a shirt. How is the best way to make the shirt play the same animation as the Character? The only way, I know, which is working, is to put the same rig, the character has to the shirt inside your model software (Blender in my case) and export it. Then play the animation on both. Recently I played around with seperating the armature from the model and add another model to the rig (as a parent) inside Leadwerks but that does not work. If you export only an rig from blender this rig has no animations inside Leadwerks. Even if you load animations in, the model, set as the parent of the rig, does not play any animation. Well I would have wondered if that worked anyway. What I know, what works is if you parent an entity to an bone inside an rig in Leadwerks, this entity moves with the bone. This is very helpful for weapon animation, but what if I need more than one bone to affect my model? Any ideas on that?
  16. Yes all this is possible. For blending use the blend value in the PlayAnimation function. To play animations only on particular bones, you need to call the animation function on the specific bones you want to play the animation. Here an example. Say you want the character to speak while running. I will simplify the structure for better unterstanding: --play running self.entity:PlayAnimation("running", 1, 500) --play talk animation only on the face self.entity:GetChild("FaceBones"):PlayAnimation("talking", 1, 500) Obviously the "FaceBones" entity most likey is called something like "Head" containing all other bones, like lip, eyebrown etc bones. Imporant to know is that if you play a new animation on parts of your model the old animation gets overwritten (so the head bones dont play the run animation obviously) and it is not nessecary to play the animation on all sub bones. Check your bone hierarchy in the editor and just play the animations on the parent. Hope you understood everything.
  17. Ok this may be a little stupid answer, but why not just send them a zip file with your files, included in the workshop file?
  18. Not bad well done :). I totally agree with @SpEcIeS
  19. MoCap? How did you do that? You dont have a professional mocap studio I guess. You used that kinect thing did'nt you? Of course, but I am talking about you have an entity in the editor for every csg brush, so for larger structures you will generate many entites. A single modle just counts as one entity. And the number of entites also affects performance know what I mean? True, but thats what I meant, you can also hide faces inside a model editing software. Actually thats a fundamental thing to even DELETE sides which are not needed, or you cannot see. So you can actually do this even better within a model. But IF you want to work with csg brushes that thing you showed about faces is very important. I dont really know what you mean, that models make the game look worse, because you can create any model you want and its up to YOU how it looks like. You can actually create models looking like the csg brushes ^^, know what I mean. But I guess what you actually mean is to not overload your scene with details dont you?
  20. Hey, to explain the blending. As I dont use this function very often dont blame me if I am wrong ^^. This is an example code to show the function: function Script:Update() if window:KeyHit(Key.D1) then self.entity:PlayAnimation("Idle", 5, 500) elseif window:KeyHit(Key.D2) then self.entity:PlayAnimation("Walking", 5, 500) end end So what happens now is that if you press "1" on the Keyboard, the entity starts playing the idle animation. Because the entity had no animation before, blending does not matter. Hope thats clear so far. So if you now press "2" then the walking animation gets played, BUT its blends from the idle animation to the new one. More precise: The idle animation needs 500 miliseconds to blend into the walking animation. So the blending always happens you just decide how long it takes, if it is nil or 0 then no blending happens. I hope this was understandable. Of course this works the other way as well if you go from walking to idle. Try experimenting with it. Its funny because I could say the exactly same thing about art :D. I have that problem with good working animations and models, but I really want to learn it. Currently getting into ZBrush. My Animation skills are at least good enough to create some basic motions. That tip on performance is very interesting indeed, thank you. Did not knew that yet, but some time ago I created an whole house with CSG Brushes and it lead to heavy performance issues, because its creates a LOT of entites. My performance where ways better when using an optimised single model. But your tip also works with models I guess. However be careful to not create more entites than you need. I dont know how good I am in level design and yes its a fun part ineed, but have not gathered much experience yet. I am working on all of my systems, you know all that coding stuff. This is where most of the beginner gamedevs fail, thats why I decided to start with that. Will definitely come back to you Well working hard, I guess cant take too long till I will show some stuff. I have huge plans working for about an year on my current project, but not much model/animation work is done yet, but as mentioned before its just an framework no real game or something but whatsoever ^^ Edit: This could be interesting if it comes to raycasting, actually its the command to perfrom an raycast: https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_Pick
  21. Hi, About that animationmanager thing: Well there are a few things to say about it. First, yes Leadwerks has/had an own animationmanager script build in, which was used back in the days, when the "PlayAnimation" function was not available, but I was talking about my own animation manager script I created myself. You cannot download this anywhere as I have not released it :D. However never mind it, as the PlayAnimation function works well and its much easier for beginners. About Blending: PlayAnimation(string sequence,number speed=1.0f, number blendtime=500, number mode=0, string endhook="") This is what you find in the documentation. See that "number blendtime", this is for blending. More precise this is the time in miliseconds to blend form one animation to another as far as I understand it. About your interaction function: Puh, would take a lot of time to indeep explain, how to do interaction, what options you have etc. However as far as I understand you want your player to interact with stuff in the world right? I have no idea how the code, I could see in the video should get this done. Where does this function even get called from? The only thing this lines of code does is to search for entities which have an "Use" function inside their script. The most common way to handle interaction is to use a raycast. I hope you are familiar in any way with that, so I dont have to explain this more detailed :D. Another way I could think of especially in those 3rd person "topdown" like style is a cylinder or sphere around the player which scans if objects around can be ineracted with, but this method may pick more than one Item at once so this could be a problem. However it would be a little bit too complicated to explain this in detail. I think you are doing pretty well so far and your stuff looks interesting. I think one of the fun parts making games is to come up with own ideas and to solve problems like that. I see you dont feel the same way :D, but maybe try it out. I know you want to focus on the art stuff, but give coding a try :). Sit down, enjoy a cup of coffee, take pen and paper and think on how to solve your problem, try it out and see what you can do. Good Luck
  22. Actually to be honest I dont use the built in PlayAnimation command, so I dont have much experience with it. I use my self made animation manager. Maybe I will put this on the workshop any time soon, because it provides more features then the build in animation function. I cant tell you for sure why its ignoring your speed value, because you did not provide the code where your char is playing the running animation. What I mentioned is that you need some blending when your character stands up its a little bit direct. To make your character go idle when you dont move, as this is what I understood you want to realise, you need to check if your character has speed in any direction, or if the play is pressing any kind of key. So you have to come up with something like this: local speed = self.entity:GetVelocity(true) local newMode = nil if speed.x == 0 and speed.y == 0 and newMode ~= "Idle" then newMode = "Idle" self.entity:PlayAnimation("Idle", 0.035) elseif newMode ~= "Walking" then newMode = "Walking" self.entity:PlayAnimation("Walking", 0.035) end Notice that you need to check if your mode is "Idle" or "Walking" already that your entity does not call "PlayAnimation" all the time this is very important. It can be pretty complicated if you have many diffrent modes, because you need to notice any circumstance there is and how it affects your mode. I would recommend you creating a seperate function for your modes this can look like this: function Script:SetIdle() newMode = "Idle" self.entity:PlayAnimation("Idle", 0.035) end function Script:SetWalking() newMode = "Walking" self.entity:PlayAnimation("Walking", 0.035) end Or like this: function Script:SetMode(mode) newMode = mode if mode == "Idle" then self.entity:PlayAnimation("Idle", 0.035) end if mode == "Walking" then self.entity:PlayAnimation("Walking", 0.035) end end This makes it easier for you and you have your code more organized. You also most likley need to set the modes more than just one time where this helps you as well. Its a little off topic, but because I am currently creating a framework, including many systems, like the animation manager, an easy UI system, AI and so on, I mentioned this would be very helpful for you as you dont want to code that much, and thats exactly the reason I am creating it. Unfortunately there is a lot of work to be done and a release can't be expected any time soon, but maybe I will provide some smaller parts in the workshop in the future.
  23. I have a question and an answer to this topic. Is there any reason you call you stuff in the UpdatePhysics function, because I see no reason for that. Correctly me if I am wrong as I am no expert. If I can give you an advice, built in a system allowing you to perform keychecks multiple times per Update. I use this method as well, I would implement it as fast as possible into your project. Works like the following: --Put this into your main.lua: --main.lua code here keyHit = {} --just declare this variable, outside the main loop --some more main.lua code --Put this inside the main loop in the main.lua file: --------------------Hit --Mouse keyHit.RMouse = window:MouseHit(2) keyHit.LMouse = window:MouseHit(1) --Alphabetic keyHit.A = window:KeyHit(Key.A) keyHit.B = window:KeyHit(Key.B) keyHit.C = window:KeyHit(Key.C) keyHit.D = window:KeyHit(Key.D) keyHit.E = window:KeyHit(Key.E) keyHit.F = window:KeyHit(Key.F) keyHit.G = window:KeyHit(Key.G) keyHit.H = window:KeyHit(Key.H) keyHit.I = window:KeyHit(Key.I) keyHit.J = window:KeyHit(Key.J) keyHit.K = window:KeyHit(Key.K) keyHit.L = window:KeyHit(Key.L) keyHit.M = window:KeyHit(Key.M) keyHit.N = window:KeyHit(Key.N) keyHit.O = window:KeyHit(Key.O) keyHit.P = window:KeyHit(Key.P) keyHit.Q = window:KeyHit(Key.Q) keyHit.R = window:KeyHit(Key.R) keyHit.S = window:KeyHit(Key.S) keyHit.T = window:KeyHit(Key.T) keyHit.U = window:KeyHit(Key.U) keyHit.V = window:KeyHit(Key.V) keyHit.W = window:KeyHit(Key.W) keyHit.X = window:KeyHit(Key.X) keyHit.Y = window:KeyHit(Key.Y) keyHit.Z = window:KeyHit(Key.Z) --Numeric keyHit.D0 = window:KeyHit(Key.D0) keyHit.D1 = window:KeyHit(Key.D1) keyHit.D2 = window:KeyHit(Key.D2) keyHit.D3 = window:KeyHit(Key.D3) keyHit.D4 = window:KeyHit(Key.D4) keyHit.D5 = window:KeyHit(Key.D5) keyHit.D6 = window:KeyHit(Key.D6) keyHit.D7 = window:KeyHit(Key.D6) keyHit.D8 = window:KeyHit(Key.D7) keyHit.D9 = window:KeyHit(Key.D8) --Special keyHit.BackSpace = window:KeyHit(Key.BackSpace) keyHit.CapsLock = window:KeyHit(Key.CapsLock) keyHit.Space = window:KeyHit(Key.Space) keyHit.Escape = window:KeyHit(Key.Escape) ----------------------------------------------- You can do the same for KeyDown of course. Now instead of "if window:keyHit(Key.E) then" you can use "if keyHit.E then". This is not only shorter, but also can be used as often as you want. Note that you need to add some characters to my keyHit list, because mine is not complete. I hope this is understandable if not I could provide a modified main.lua including my code so you can take a look at it. About your actual problem, as far as I understood you just want the person to stand up if you press E. The problem is that it just plays the animation as long as keyHit is true and that is just the case for one millisec maybe. So here is the fix: if self.entity:GetAirborne()==false then if window:KeyHit(Key.E) and newmode ~= "Idle" then newmode = "Idle" self.entity:PlayAnimation("Idle",0.035) end end Now the entity plays the idle animation if you hit E. The question under which circumstances you want the entity to sit? You have to code this externally, not within the KeyHit command!
  24. Hi, pretty simple question. Is there a way to get the files/filenames of all files within an folder. Could not find something like that in the API. I used the lua io.popen function and it works ok, but seems to open up an cmd window for a second, which does not look good. However any ideas?
  25. See that in my first post. But I know of found the problem. Had to do with the animations attached to the objects. Something went wrong there, still I dont know what exactly.
×
×
  • Create New...