Jump to content

Dragonfreak

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by Dragonfreak

  1. So, during the progress of developing the game for the tournament, i came to the conclusion i had no explosion effects yet. So, i went on to create some "effects"

     

    To keep it short, i got a shader that uses "SetVec2" to set the "zoom" (size of 1 frame) and the coords of 1 frame.

    This is all cool and stuff.. If it's only for 1 sprite lol, now i'm really new to shaders and they really confuse me at the moment.. But considering how much time there is left i hope someone could help me out here.

     

    After some googling / forum searching it came to my understanding you could use the "setcolor" to make individual settings for each sprite!

     

    If someone could possible help me that would be really great :)

     

     

    The current shader that i'm using

    #version 400
    #define BFN_ENABLED 1
    //Uniforms
    uniform sampler2D texture0;//diffuse map
    uniform samplerCube texture15;//BFN map
    uniform vec4 materialcolorspecular;
    uniform vec4 lighting_ambient;
    uniform int decalmode;
    uniform float materialroughness;
    uniform vec2 uvcoords = vec2(0.047,0.33);
    uniform vec2 zoom = vec2(21,3);
    //Lighting
    uniform vec3 lightdirection[4];
    uniform vec4 lightcolor[4];
    uniform vec4 lightposition[4];
    uniform float lightrange[4];
    uniform vec3 lightingcenter[4];
    uniform vec2 lightingconeanglescos[4];
    uniform vec4 lightspecular[4];
    uniform vec4 clipplane0 = vec4(0.0);
    //Inputs
    in vec2 ex_texcoords0;
    in vec4 ex_color;
    in float ex_selectionstate;
    in vec3 ex_VertexCameraPosition;
    in vec3 ex_normal;
    in vec3 ex_tangent;
    in vec3 ex_binormal;
    in float clipdistance0;
    out vec4 fragData0;
    out vec4 fragData1;
    out vec4 fragData2;
    out vec4 fragData3;
    void main(void)
    {
    //Clip plane discard
    if (clipdistance0>0.0) discard;
    
    vec4 outcolor = ex_color;
    vec4 color_specular = materialcolorspecular;
    vec3 normal = ex_normal;
    //Modulate blend with diffuse map
    outcolor *= texture(texture0,ex_texcoords0/zoom+uvcoords);
    if (outcolor.a<0.5) discard;
    
    //Blend with selection color if selected
    fragData0 = outcolor;// * (1.0-ex_selectionstate) + ex_selectionstate * (outcolor*0.5+vec4(0.5,0.0,0.0,0.0));
    #if BFN_ENABLED==1
    //Best-fit normals
    fragData1 = texture(texture15,normalize(vec3(normal.x,-normal.y,normal.z)));
    #else
    //Low-res normals
    fragData1 = vec4(normalize(normal)*0.5+0.5,1.0);
    #endif
    float specular = materialcolorspecular.r * 0.299 + materialcolorspecular.g * 0.587 + materialcolorspecular.b * 0.114;
    int materialflags=1;
    if (ex_selectionstate>0.0) materialflags += 2;
    if (decalmode==1) materialflags += 4;//brush
    if (decalmode==2) materialflags += 8;//model
    if (decalmode==4) materialflags += 16;//terrain
    if (materialroughness>=0.5)
    {
     materialflags += 32;
     if (materialroughness>=0.75) materialflags += 64;
    }
    else
    {
     if (materialroughness>=0.25) materialflags += 64;
    }
    fragData1.a = materialflags/255.0;
    fragData2 = vec4(0.0,0.0,0.0,specular);
    }
    

  2. First off: Happy new year everyone! I hope everyone had a blast ^_^

     

    So after all the holiday and getting my new PC madness joy (before i had about 5 year old laptop i was working on that was really on the edge of dying (Either by itself or by me of frustation))

     

    I finally got back around to continue on my Spinguins game (speeding up the progress to catch up with the time i lost) and my main question is now, due noticing the "GUI" folder which i thought wasn't fully released yet; How can i start of doing this?

     

    My most question goes towards the "ProgressBar.lua" as i would love to use that as a health bar in my game! I did try a bit of fiddling but the results was just a plain black screen with a tiny progressbar in the left top corner :P

     

    So i hoped someone could help me out here :)

  3. That's odd, there is possible 1 thing you can try (which i did use for my private game once) is the follow:

     

    Create a shortcut on your desktop (or anywhere you feel comfortable with) and set the URL to the following:

    steam://run/355500//+game 735323135

     

    This will launch the leadwerks game launcher and tells it to use this game. If this doesn't work then i'm all out of ideas :3

     

    Hope it helps!

  4. Very cool! The amount of immersion is overwhelming, didn't expect it to be that much. You can definitely see the amount of effort and passion into this project. Also glad to hear that you've passed your exam. smile.png

     

    Thanks a lot for your awesome words :D

     

    You really helped me a lot with plenty obstacles and those informative tips how to improve some performance ^^ Thanks to that i could keep awesome things like the lights in the lanterns (i was really bumped out that they started to lag with my settings and really took away some of the feelings in the game) and overal the tips you gave me / answers on my questions regarding trees haha.

     

    Cookies for you /o/

  5. Thanks!

    Good one about the gameplay info & screenshots hehe, i'll make a section for that tomorrow :)

     

    Tho, i won't really do a video considering the game is rather short.. It would spoiler everything within seconds hehe :)

    Same thing applies slightly a bit for the screenshots.. But those are less harmful then a video haha

  6. So, after weeks of the promise i would create a post regarding my exam game that i fully created in lua Leadwerks engine.

    I divided this post a bit up in sections, so feel free to wander around and see how much you wish to read smile.png

    Realm of the Lamb:

    This game is based on the League of Legends champion named Kindred. The idea was together with the customer (my teacher that acted as a customer) to promote Kindred a bit more next to the trailer teaser with a small game that shows the essence of kindred a bit more.

    I achieved this with mostly focusing on the sound part of the game, the environmental feeling and a tiny puzzle / small spooky factor and tricking you.

    Below you can see the cover picture that my wife has proudly made for me smile.png (She also made most of the Hud / Gui / Menu)

    Sorry for the fact that it's dutch tho ^^ I needed it for my exam hehe.

    You can download the game from this dropbox link and play it on your device. (I doubt anyone will get this error, considering everyone here will most likely have leadwerks on their device, but i included an openAL install just in case wink.png)

    It's also possible too play it from the workshop! Check it out!

    Make sure to listen closely!

    Gameplay:

    This game has little pieces of all kind of things. Puzzles, jump scare, running for your life and all that sort of things smile.png

    Now more about the game(play)!

    The story goes that you're a human that just got into an accident which resulted you being on the brink of life and death. While being a soul, normally kindred would give you an easy choice, but not this time. Sometimes they get so bored of their work and feel like playing a little "game".. They'll give you a reward for it too, if you can beat them you are worthy enough to get your life back. If you can't beat them.. Your soul will forever linger in the Realm of the Lamb.. Are you up for the challenge?

    The controls are pretty simple, you use WASD to walk around and use the mouse to look around. the "E" button is an interactive button which you will only use once actually..

    Some screenshots of the game:

    Kindred lore:

    "Tell me again, little Lamb, which things are ours to take?"

    "All things, dear Wolf."

    Separate, but never parted, Kindred represents the twin essences of death. Lamb's bow offers a swift release from the mortal realm for those who accept their fate. Wolf hunts down those who run from their end, delivering violent finality within his crushing jaws.

    Copied from the league of legends wiki site here you can find the full background lore instead of the small snippet i placed above.

    A little look more into my exam period:

    First of all, i learned ALOT during this period. Even tho it isn't technically allowed during the exams since you needed to master this. (funny story tho, my "study" rather focused on web stuff instead of game while my paper clearly states game-developer lol, learned 80% of all i know in the exam period and before with 70% being Leadwerks)

    But yeah, i learned a crazy lot and i loved the whole process of it. It was quite stressful aswell to be honest, normally you work together with atleast 1 person so you would split up the things you required to do. Since i was a special case, i worked alone. So i was all alone with all these paperworks aswell lol, very delightful.

    I also had quite a lot of help from good friends (One of em is also a Leadwerks *cough* nerd *cough* <3 ), from my wife and from this community. smile.png

    Mentally i also had a lot of support from my wife and friends ^^ Staying sane was the hardest of it all but i managed in a sense haha.

    And now! A little more in depth on the whole process!

    It was terrible (O_O") the end.

    Just kidding haha, the process of actually recording voices was very awesome and scary at the same time, me and my wife both felt like little school girls and laughing all the time in between recordings xD

    Truly, i never thought the recording would came out this good. (To clarify a bit, we only did the NPC's, the kindred voices are all from LoL it self, the game is full of copyright lol)

    Next to that, finding out how i can finally get animated models from cinema 4D was a truly surprising accidental discovery. (i have tried before to do it, without any success which was frustrating)

    For anyone struggling with this matter, you need a skin on your model and that's pretty much it! It was that easy all along.

    Tho, finding this amazing discovery i of course wanted to abuse this matter. I messed with the animation a bit in cinema 4D, trying to merge 2 animations on 1 exported model. This however, was a terrible mistake as for some reason the second animation screw up for no particular reason and i ended up needed to rotate each frame (over 40 frames) a few bones just to correct it all. Ofcourse i could've done this easier by exporting 2 models, exporting the animation and merge it into another model. But then again, i'm not always the brightest especially when sanity isn't in the same room ^^ but it was fun to do anyways and i learned new things in that process aswell smile.png

    I think i'll round up the post a bit here haha, if anyone really wants to know more of my progress then i'll add it and update this post smile.png

    Thanks for reading if you did read this far! You're truly awesome ^^

    Have a great day and let me know what you think of my game! smile.png

    A few more screenshots i made during development ^^

    Here you can see my first attempt to create lanterns based on pivot locations from 1 master pivot ^^ (so 1 script for them all, my purpose here was to make the "wave" effect without editing enormous amount of lanterns each time)

    Also funny if you can read it, i included the "brightness" value of each lantern, i later used this to define if it should be 1 lantern or 2. I also hooked up the other brightness channel later on to define if the distance should be larger or smaller! So this was easy for corners or just solo lanterns by editing only that specific pivot smile.png

    Adding the lights, nothing too special here smile.png

    My first attempt with messing around with the NPC looks and feels (I used a purple pillar nearby to see the difference in height and also to actual get the "depth" due the plain white terrain haha)

    Adding in the first trees! Found my first beta NPC looks aswell and trying to show the general idea of what i had to my customer so he would have an visual example of how the game will look in general (without the fancy textures that my wife edited for me later)

    Funny example of how i'm creating a ring with runes on it with trials and errors hehe, but it turned out just great in the end!

    First time messing around with the flowgraph! I was pretty proud of my little creation here actually. (i improved it a lot later on ofcourse and added a lot more items, i won't show how messy it looked in the end haha)

    I was also very glad that i managed to use 1 script on both rings, use the script settings to change the important values and make it all hook up just right!

    My tiny example of how i did the lantern controller, i eventually added a few more controllers because the list became waaaaay to huge!

    Here is my attempt to create the end portal, this ofcourse changed quite some due the textures and the weird "gem" also got it's proper "update" to make it all look solid as one

    I can't add too much more without spoilers! Because from this point on, all the screenshots i got pretty much gives away the game to some extend. The last thing i can show you, is my animated sprite which i used to animate the soul essence icon. It isn't really anything in your face, i wouldn't be surprised if people didn't even notice it in the first place, but tiny details are always cool in my opinion.

    https://puu.sh/pD5Bc/8314553bbe.png

    • Upvote 4
  7. Presume this is in visual studio? Considering all i have done so far is inside the leadwerks thing itself :P As i don't have the pro version upgrade (yet, really tempting to buy it... But money is a pain >_<)

     

    Tho, if this is possible even without the pro version, how exactly do i need to rebuild it? (Maybe noobish question, but my school barely thought my anything :) )

  8. Complete spritesheet lua & shader + an example spritesheet on how it works smile.png

     

    Steps to follow:

    1. Create a sprite in the scene.

    2. Attach the Custom spritesheet.lua

    3. Attach the "testing" material to it.

    4. Run the game!

     

    Now, this is a very basic one. If you want to use an other spritesheet, all you have to do it change the Frame width & height in the Script tab smile.png (of 1 frame!!)

    And if you desire to change the speed, change the frame speed, this sets the actual speed at how fast the animation will go (the lower the number, the faster it goes smile.png )

     

    And that's all to it! Enjoy happy.png

     

    Credits to shadmar's original spritesheet shader from his fire pit :) (I modified it slightly for this purpose)

     

    http://puu.sh/pLljg/40232be99f.zip

  9. Goodday everyone!

     

    I have this random question which i have been wondering for a while now. Considering next week is my exams which i'll proudly show my created small game made with leadwerks :)

     

    Now the question, i noticed as soon as it gets standalone exported, it opens a console screen with the game. Now this isn't a huge problem.. But i think it'll look neater without :)

     

    I have tried to follow up this post a bit: http://www.leadwerks.com/werkspace/topic/6445-le3-hide-dos-screen/

     

    However, i got a bit confused and it doesn't seem to work (Perhaps because it was le3 and not le4?)

     

    Anyone got any suggestion / tip / method for me to solve this?

     

    Thanks in advance!

  10. I felt so bad that i almost forgot to post here again while i got home (My day has really been crazy and busy haha when i got home i just started playing a game and relax :P)

     

    Eitherway! I promised a screenshot ^^ Now, this might not be the best screenshot but i suppose it does the trick

    f04b6e4a6a.jpg

     

    You mostly need to look at the part where the origin of the beam is. I have checked this project again (been weeks that i have visited this due my exam project with the animated sprite sheet example that i posted earlier) and i noticed that i created the sprite inside the script.

     

    Spritesheet:

    1e0a3450dc.png

     

    When i first started making things in leadwerks i tended to do this to understand the lua scripting method a bit more. (if i explain it right hehe)

     

    Eitherway! To the point!

     

    I just realized by looking at my code.. That i used a different method for the sprite.. That is a bit embarrassing.

    But! I got my own solution ^_^ (The shader i'm currently using is a small variation on the earlier mentioned of the shadmar's firepit which is mostly edited speed & images considering mine always needed to loop)

     

    Right, to get my piece of code;

     

    Option 1:
    -- Full spritesheet size
    Script.texture_W = 300
    Script.texture_H = 100
    -- Size of 1 frame
    Script.original_w = 50
    Script.original_H = 50
    -- Current Frame Position
    Script.currentAnim_X = 0
    Script.currentAnim_Y = 0
    Script.animate = false
    function Start()
    self.sprite = Sprite:Create()
    self.sprite_Material = Material:Load("*material name*.mat")
    self.sprite:SetMaterial(self.sprite_Material)
    local texture = self.sprite_Material:GetTexture()
    self.texture_W = texture:GetWidth()
    self.texture_H = texture:GetHeight()
    self.sprite.Shader = self.sprite_Material:GetShader()
    end
    function UpdateWorld()
    if window:KeyHit(Key.Space) then self.animate = true end
    if self.animate then
     self.currentAnim_X = Math:Inc((self.texture_W/self.original_W)-1,self.currentAnim_X,1)
     if self.currentAnim_X == (self.texture_W/self.original_W)-1 then
      self.animate = false
      -- I used this method to check if the animation reached the last spot of the spritesheet or not. If not, reset it to 0 on the next layer. If
      --yes, keep it at the end.
      self.currentAnim_X = (self.currentAnim_Y == 2 and (self.texture_W/self.original_W)-1 or 0) 
    
      -- Check if this is on the last row of the animation, this can probably be done better but i have very limited time in my project hence
      -- the dirty way ( I would recommended checking the Height of your sheet and dividing it by the height of the frame )
      if self.currentAnim_Y < 2 then self.currentAnim_Y = self.currentAnim_Y + 1 end
     end
    end
    
    self.shader_Spritesheet:SetVec2("uvcoords", Vec2(self.currentAnim_X,self.currentAnim_Y))--set uvcoords in shader
    self.shader_Spritesheet:SetVec2("zoom", Vec2(self.texture_W/self.original_W,self.texture_H/self.original_H))--set zoom in shader
    end
    

     

    With this method, you can use the whole spritesheet on a material so that you can attach it to a sprite (My mistake earlier! I thought it was a texture that was attached!) and then you can attach the shader of macklebee to the material.

    The code will get the shader from the material and use it's information to what it needs to do.

     

    #2: Another option is: (i would've loved to add it above in the code part aswell but i'm awful tired at 2:35 haha)

    This is similar to the above code, but instead you create the whole material inside the code and attach the texture + shader to it.

    This will only change the way and over complicate (in my opinion) it in the "Start()" function. Ofcourse, if this is what you desire, go nuts :)

     

    Yet another option that i thought up right now;

    You create the sprite in the editor itself, add the material that has the texture & shader attached (or well, you could not do that and go partly option 2 with over complicating inside the start script :P) then you attach a Script that has the above method handling in the UpdateWorld() (Or, you could place it elsewhere, whatever you desire the most ofcourse)

    While having in the Start() the information of the texture a bit the same way we did above, but instead of loading a material, we'll just do "sprite_Material = self.entity:GetMaterial()" and the rest of the process would be pretty much the same.

     

    I hope i explained it enough this way ^_^ i hope i didn't went overboard with my wall of text haha, i just like to be detailed and well, hopefully understandable ofcourse :)

     

    If there are any questions left, let me know and i'll try to reply ASAP! (This time for sure :) )

     

    Another thing; Excuses if i might go a bit overboard with my "emoticons". I tend to use them alot, especially when i'm excited ^_^ (see? There i go again haha) i try to reduce this to a minimum and not flooding the post with it :)

  11. Still at school aswell haha, waiting for the last conversation with my teacher tongue.png

    I'll make screenshots of the sprite as soon as i get home wink.png Currently i got no mouse and my CTRL button is broken on my laptop which makes it pretty hard to do this haha.

    As far i know it should also still work, if i remember right i did this that exact way. I got the information which texture is on the sprite and then used the animating script on it. Another way which is possible, is just create the sprite object the way you want it and then attach the script to it and do all the texture from within the script and attach it to the sprite with self.entity:SetTexture(*texture*)

     

    So yes, that should work happy.png

     

    Edit: Fixed confusing typo :P

    • Upvote 1
  12. I might be able to help you with this one, i also checked out the shadmar's firepit but considering i'm horrible with shaders just yet, it wasn't the best example to play with haha (it's still good! Don't get me wrong in that wink.png ) i did however found another post which is from macklebee which showed how to draw small parts from a texture. With this you can create your own "animation" function and sequence it in the way you like! I'm currently still at school and almost finished, when i get home i'll show you exactly what i mean wink.png

     

    For now, here is a link; http://www.leadwerks.com/werkspace/topic/12537-drawing-a-section-of-a-2d-texture-setting-uv-coords/#entry90453

     

    This is currently my (messy?;P) code to animate it

    
    Script.original_W = 280/1.5
    Script.original_H = 280/1.5
    Script.texture_W = 280
    Script.texture_H = 280
    Script.screen_W = 600
    Script.screen_H = 600
    Script.animate = false
    Script.currentAnim_X = 0
    Script.currentAnim_Y = 0
    
    in start:
    self.soul_Essence_Anim = {}
    
    
    self.soul_Essence_Tex = Texture:Load("Materials/Hud/Soul Essence Anim2.tex")
    self.texture_W = self.soul_Essence_Tex:GetWidth()/1.5
    self.texture_H = self.soul_Essence_Tex:GetHeight()/1.5
    
    in updateWorld()
    if self.animate and not upgradeScreen and not paused then
    self.currentAnim_X = Math:Inc((self.texture_W/self.original_W)-1,self.currentAnim_X,1)
    if self.currentAnim_X == (self.texture_W/self.original_W)-1 then
    self.animate = false
    self.currentAnim_X = (self.currentAnim_Y == 2 and (self.texture_W/self.original_W)-1 or 0)
    if self.currentAnim_Y < 2 then self.currentAnim_Y = self.currentAnim_Y + 1 end
    end
    end
    
    in the postrender stuff
    self.shader_Spritesheet:SetVec2("uvcoords", Vec2(self.currentAnim_X,self.currentAnim_Y))--set uvcoords in shader
    self.shader_Spritesheet:SetVec2("zoom", Vec2(self.texture_W/self.original_W,self.texture_H/self.original_H))--set zoom in shader
    

     

    Short explanation: self.texture_W and _H get the current full texture size with all the animated sequences in.

    self.original_W and _H are the size of the actual picture you want to animate.

    currentAnim_X goes through the horizontal animation and currentAnim_Y goes through the vertical one.

     

    What i did here is pretty much first go through the first set of animation then set it to the second row and do the same and so on.

     

    My animated spritesheet:

     

    8314553bbe.png

     

    I actually went on way longer then intended haha, i hope this helps somewhat with your current question smile.png Let me know if you need more information and i'll come back at you as soon i get home!

     

    Goodluck happy.png

     

     

    EDIT: In this example i mostly focused on the 2D screen draw, but this is also usable on sprites! When i'm home i'll give you an example that i made with the sprite ^^

  13. Heey everyone happy.png First time on the forums biggrin.png

    First of all, i love this engine and it really motivated me back into programming happy.png (due my horrible school study i really lost hope in it T_T)

     

    Now to the point happy.png I have recently created a skybox, with a simple tool. But i was wondering if it was possible to animate this? I'm horrible with searching around on forums & google regarding leadwerks (in general usually ;P) which is the reason i felt like just asking it happy.png

     

    If it isn't possible, it's also cool! Because i like the way in it's current state, but a lil extra favor can never hurt wink.png

     

    Side note: I'm developing a game for my Exam project, so this could add a nice extra point ^^

     

    Thanks in advance!

     

    ~Dragonfreak

     

    skybox currently using:

    ae5aec9fc8.png

×
×
  • Create New...