Jump to content

WSI

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by WSI

  1. 5 hours ago, Josh said:

    It's telling you what the default value is if you don't include that parameter. :cool:

    Even if there was a page explaining that, what are the chances you would have seen it?

     

    The condescension isn't justified, Josh.  You're being disingenuous.

    I said in my previous post:

    Quote

    "That's another reason why the example code on that page should have the parameters included, to show the actual correct formatting. I could have looked at it and realized "Oh, *that's* how it's actually formatted", and everything would have worked."


    The only place any info is noted about parameters is where it says, for example: string title="Leadwerks". I understood the 'string' and 'number' are just indicating the type. I also understood the 'name' and 'numbers', etc, were just examples, and didn't have to be typed in verbatim. The only bit I didn't understand wasn't actual parameters is name=, x=, etc. So it's not like I went into this completely brain-dead, or didn't try to think through it myself before posting here.

    However... 

    The actual code sample lower on that page just has Window:Create():

    --Create a window
    window = Window:Create()
    context = Context:Create(window)
    world = World:Create()
    local camera = Camera:Create()
    camera:Move(0,0,-3)
    local light = DirectionalLight:Create()
    light:SetRotation(35,35,0)


    There's no parameters included in the actual example code. So, the only example I have to go on is the bit at the top with all the extra info.  I'm following your documentation.

    So again, if that bottom code sample had included parameters inside the (), I would have realized that's the correct way to format it, and then it would have clicked that the "String name="Leadwerks", etc... was a demonstration/explanation, not the actual format.

    You know how I've said in other posts how experienced programmers forget what it's like to be brand-new, and tend to make assumptions of what the student  already knows/understands? This is a grand-slam perfect example of that.

    Instead of being condescending and sarcastic to a sincere case of confusion and inexperience, you, or someone else, could go through the documentation and update it to make sure all the examples are detailed and thorough.
     

  2. 6 hours ago, Alienhead said:

    Neither,  those doc examples show what the command takes as a parameter.. It's just for reference..  When actually entering the parameters for the command there is no = ( equals sign ) used.  Think of the Syntax section of the docs as a legend on map - it simply highlights what the command itself is looking for.

    • Window Create(string title="Leadwerks", number x=0, number y=0, number width=1024, number height=768, number style=Titlebar)

    Would translate into 

     win = Window:Create("Leadwerks", 0, 0, 1024, 768, Window.Titlebar)

    If the actual command doesn't use =, then why is it noted like that in the documentation?
    That's another reason why the example code on that page should have the parameters included, to show the actual correct formatting. I could have looked at it and realized "Oh, *that's* how it's actually formatted", and everything would have worked.

    So, effectively, I can't trust anything in the documentation as being accurate and will have to constantly second guess "well now... is this how it's supposed to be typed, and I'm doing it wrong? Or did they deliberately format it differently for demonstration, while providing no example of how to do it correctly?"

    Someone should review the docs for accuracy and/or thoroughness. Make sure example code written is complete (includes parameters where applicable, etc), and not assume someone new will look at it and "just know" what the correct approach is.

  3. So, right off the bat, I'm hitting a wall.

    I'm trying to change stuff in the code to make sure I'm understanding it. 

    I looked up how Window:Create works, and I see that it accepts a number of parameters. 
    Per this page: https://www.leadwerks.com/learn?page=API-Reference_Object_Window_Create

    I put in the parameters based on the explanation, and it gives me an error when I try to run it.
    Unfortunately, the example shown on that page doesn't actually use any of those parameters. It's just Window:Create(). So I have nothing to compare against and don't know how the parameters are supposed to be formatted. 

    For example, am I supposed to actually put the "number x=0"? Or just "x=0"? (minus the quotes). I tried both ways, and both give errors.

    This is what I run into every time I try to learn this engine. I follow what it shows in the documentation, and it doesn't work. Same thing happened when I tried to get a simple ball I modeled in Blender to move. Followed the documentation... didn't work. And it's been the same in every other thing I've tried.

    Is the documentation not accurate? Maybe it's not me just "not getting it"? Is this stuff not noticed by others because everyone else already knows how to program and doesn't have to reference it?

    How can I learn if following the documentation returns errors?

    This is why I get frustrated and give up. Literally every step of the way, everything I try to do, I hit these walls. 

  4. On 9/11/2022 at 3:21 AM, Josh said:

    @WSI You're probably smarter than you think. When I look at that code, I have no idea what it is doing, and it would take me a long time to walk through it and figure out what is happening. Most of the time programmers don't understand code they didn't write themselves.

    Also, meta tables are some of the most obscure/advanced concepts in Lua. I'm not even sure if I use them at all.

    Hey, Josh. I really appreciate that vote confidence. If only I could convince my brain that's the case lol.

    Funny thing is, I understand programming in concept. I remember hanging out with a friend (super gifted programmer) and being able to understand concepts, and even make suggestions when he was working out how to approach something... and he'd actually use them, and they worked out.

    True story, I'd started to learn BASIC on my family's Vic-20 as a kid. Would sit in front of the living room TV, open the manual, type in the code in the book, then take it and apply it to my own ideas. I wanted to make a text adventure game. Wish I'd stuck with it. Could probably be a decent programmer by now if I had. Of course, being BASIC, and not interfacing with any other API, it was a lot easier to understand what was going on.

    It's when I get down into it myself and start working with the syntax that my brain just goes blank, and I have no clue what's going on. That's the thing I need to get past.

    That said, if you have trouble following what others' code is doing... Then maybe looking at others' code to learn isn't a good approach? It's definitely discouraging when people show me examples of code, and I don't know what I'm looking at. Because my assumption is showing me the code *should* be helpful... but it isn't. It leaves me more confused than anything.

    Edited:
    Anyway.. I took a personal day at work today specifically because I'm determined to sit here and work at this 'til there's some kind of breakthrough and my brain "gets it".  Yes I'm serious lol. I get weeks of personal time every year, which I'm terrible at using, so I always have way too much left by the end of the year. So... It's fine :p

  5. On 9/7/2022 at 10:13 PM, Yue said:
    
    -- ***********************************
    -- Proyecto : Astrocuco
    -- Scripter : Yue Rexie
    -- Fichero  : CInput.lua
    -- ***********************************
    -- Notas 	: Clase CInput para 
    -- 			  crear el objeto Input.
    -- ***********************************
    
    
    CInput={
    
    	window = nil;
    
    	New = function (self)
    		local this={}
    		setmetatable(this,self)
    		self.__index = self
    		
    		function this:Init()
    		
    			self.window = Window:GetCurrent()
    
    			System:Print(">>> ### CREANDO OBJETO INPUT... ¡OK! ### <<<")
    		end
    
    		function this:KeyHit(CodeKey)
    
    			return (self.window:KeyHit(CodeKey))
    		end
    
    		function this:KeyDown(CodeKey) 
    			return ( self.window:KeyDown(CodeKey))
    		end 
    
    		function this:FlushKeys()
    			self.window:FlushKeys()
    		end
    
    		function this:MouseDown(CodeKey)
    			self.window:MouseDown(CodeKey)
    		end
    
    		this:Init()
    		return(this)
    	end
    }

    Check out some of my object-oriented flow programming. Esto es una clase, y por lo regular la pongo en un fichero aparte. 

    Ahora el siguiente paso es construir un objeto de esa clase.

    
    
    -- File Main.lua
    import("Class/CInput.lua")
    
    input = CInput:New()
    
    -- Sample.
    if input:KeyDown(Key.F) then
      System:Print("Key F Down")
    End

    Remember from the beginning that your whole game is one big object, which must be made up of other objects. Think of it as a car, a single object that has other objects, the wheels object, the chassis object, the engine object, the steering wheel object. All these objects must communicate with each other, the pedal object when pressed accelerates the motor object and makes the car move. 

    The Main file, is the input file to the program, the rest are the way to structure your code. The entities within a map can be assigned scripts, but everything internally is executed from the Leadwerks core in a Loop depending on the case or at the start of the game. 

    I appreciate you sharing that. I have to be honest, though... I don't know what I'm looking at lol. 
    I'm just trying to understand Lua and LW3D's specifics... Object oriented programming is well beyond me at this point.
    I'm sure it's helpful to others who are further along though.

  6. 15 hours ago, Alienhead said:

    Well  you do need a MAIN.lua, but it doesn't have to be the framework main.lua included with LE.

    Here's the most basic framework you need to start a project.  It creates and spins a cube on the screen.


    -- Create a window
    window = Window:Create("Start", 0, 0, 800, 600, Window.Titlebar+Window.Resizable)  --<< we need a window to start


    -- Create the context panel 
    context=Context:Create(window) --<< we need a panel; to draw to ( panel is created inside the window )

    world = World:Create()
    World:SetCurrent(world)  --<< we need a world to play in. :)

    -- Make a 3d cube
    entity = Model:Box() --<< we need a 'thing' in the world to look at .


    -- Main Loop
    while true do

        -- do your 3d stuff here
        entity:Turn(0,1,0)   --<<< make the 'thing' do something.

        --Update the app timing
        Time:Update()

        --Update the world
        world:Update() ---<< update the world ( let a day pass )

        --Render the world
        world:Render()  -- << no other 3d operations will show up after rendering, until the next pass


        -- If you were doing any 2D, text or images
        -- they would go here. After Rendering but
        -- before flipping.

        context:Sync(false)   ---<<< flip everything that happebd in this loop to the display buffer.

    end

    I copied this and am going to use it as my base main.lua for now.

    Thank you again for typing that all out.

  7. 1 hour ago, Alienhead said:

    Well  you do need a MAIN.lua, but it doesn't have to be the framework main.lua included with LE.

    Here's the most basic framework you need to start a project.  It creates and spins a cube on the screen.


    -- Create a window
    window = Window:Create("Start", 0, 0, 800, 600, Window.Titlebar+Window.Resizable)


    -- Create the context panel 
    context=Context:Create(window)

    world = World:Create()
    World:SetCurrent(world) 

    -- Make a 3d cube
    entity = Model:Box()


    -- Main Loop
    while true do

        -- do your 3d stuff here
        entity:Turn(0,1,0)

        --Update the app timing
        Time:Update()

        --Update the world
        world:Update()

        --Render the world
        world:Render()


        -- If you were doing any 2D, text or images
        -- they would go here. After Rendering but
        -- before flipping.

        context:Sync(false)

    end

    Ah okay, that makes sense. So basically do what they do in the Lua tutorial. I could try that. Maybe not having that wall of green text will at least help me focus on what I need "right now".

    I think I just need to figure out how translate what I'm seeing on screen into "plain English". Once I can back the code and understand it that way, I know I'm 'getting it'. Until then, it's like reading Greek.

    But.. I'll keep pushing at it!

    Thanks for the explanation.

    • Like 1
  8. 13 hours ago, Genebris said:

    Have you tried just going though a list of classes and method in Leadwerks? You will see what you can do and example show you when you can use it. Try reading various methods of Entity class.

    https://www.leadwerks.com/learn?page=API-Reference_Object_Entity_AddForce

    I did actually try that approach to import a simple ball I modeled in Blender and make it move forward by pressing W. It wouldn't work. The ball wouldn't move. I couldn't figure out what I was doing wrong because, again, I don't know what I don't know. Looking at this monster list of things in the API reference was overwhelming and I didn't understand what I was looking at. So I got frustrated and gave up.

    I can look at it again, but I think the same thing is going to keep happening.. I don't understand what I'm looking at, so all I'm doing is copying and pasting (or re-typing if I choose that route) code provided to me. It's not helping me learn, and I still won't know where/when to use it, if I don't understand what it's doing. 

    This is the wall I keep hitting, and it's why "just start doing it" doesn't work for me. It's like knowing how to bake, versus following the steps on a cake box. Following the steps on the box will yield me a tasty cake in the end. But it won't teach me how to bake.

    I'm genuinely impressed by how people self-teach themselves this stuff. I don't understand how they do it.

  9. 9 hours ago, Alienhead said:

    Take small steps... Like Yue said, don't dive into the Main.lua..  create a blank project and start by rotating a box around the screen.  Once you have familiarize yourself on how to do that - then make the box change color or scale bigger etc...   before to long you will have a basic concept on how things flow.. plant that seed ! :) 

    To be honest the programming language really isn't the obstacle to overcome,  be it C++, LUA, c# ... or whatever..   Leadwerks ( or any other game engine ) is going to take the same instructions regardless what coding language the instructions were sent from. Sure theres some differences between the actual languages which makes one choose one over the other but when it comes down to it - Leadwerks ( or whatever engine ) is what you need to learn.. The languages just give you a means to tell the game engine what you want done.  The real learning is in the game engines themselves.

    I've been coding for 15 years solid,  I came over to Leadwerks about 9 months ago. I restarted my project 3 times, not because I didn't know how to code,  while learning the in's and out's of the game engine.  So as you can see the language is no barrier, it's getting a good understanding of what your working with, how you want it to work and best avenues to take provided by the game engine itself.. 

    Now that's a very different perspective on it. My Spanish mixed with Greek analogy actually makes a lot of sense from that angle. It's not the Lua that's messing with me, it's the LW specific stuff. Interesting! So I guess I had the right idea there.

    As for for not diving into Main.lua.. I was under the impression that Main.lua is required? Isn't that what's run first, regardless? I will say, looking at Lua, and all those commented out bits does feel a bit overwhelming.

  10. 10 hours ago, Yue said:

    For me the system that most favors me in Lua, is to simulate OOP programming (Object Oriented Programming), I do this through tables and files. What I do is to take a big problem and divide it into smaller parts. And to do this I had to start from scratch from main, and manage my own structure.  With time you develop skills, I don't really consider myself a programmer, but I think that with time I have improved somewhat, because I am no longer trying to learn how to do things, but I am already doing them. 

     

    That's really cool.

    I'm still at the point of learning Lua.. then looking at programs written with it in Leadwerks, or Love2D, etc... and proceeding to scratch my head as I try to understand what I'm reading. It's like understanding basic, level 1 Spanish, then reading a paragraph with Greek mixed in. I don't know Spanish that well, and don't know Greek at all, so I can't decipher what is what. It all becomes a confusing jumble.

    I need to figure out how to bridge that gap where I don't know what I don't know. In other words, I can only look up how to do "x" in Leadwerks, if I know "x" exists in Leadwerks in the first place.  If that makes sense.

    But I guess I'll just have to keep bashing my head into it 'til it gets through... somehow. I don't know why this is so complicated for me.

    • Like 1
  11. I'm on the struggle bus wrapping my head around Lua as it is. Actually, I think it's more learning to think like a programmer that's messing with me. The syntax itself isn't difficult to learn. When/how/why/where to use it is what's challenging me.

    C++ would probably melt my brain entirely, though. And I kinda need my brain.

    I'm much more on the creative side of things. I wanna learn Lua just so I can at least create good prototypes or proof-of-concepts. By no stretch am I trying to become an expert at programming. So, Lua will have to be enough for my needs.

    Thanks for confirming Lua in UltraEngine!

    • Like 1
  12. So, because I'm a masochist... or at least just really stubborn and hate giving up on stuff... I'm going to jump back into learning Lua. I don't know what it is that's blocking it from "clicking" with me, when it's apparently such an easy thing to learn, but maybe I can figure it out if I bang my head against it enough.

    That said!

    Is Lua going to be supported in UltraEngine as well?

    • Like 1
  13. On 7/17/2022 at 5:17 AM, Thirsty Panther said:

    Have you had a look at the FPS template in Leadwerks.

    It has many scripts already available to make a standard FPS game.

    It sounds like you are very comfortable with the artistic side of game development. Use these skills to craft an interesting environment for a FPS game. Use the assets  from the workshop and the FPS tutorial .

    https://www.leadwerks.com/learn?page=Tutorials_Games_First-Person-Shooter

    Use the terrain editor to create your environment. Add a FPS player, add some enemies and create your story. No scripting required.

    Heya, thanks :)

    I have looked through the script, when I was trying to figure out how to get a model to just move forward when I pressed a key, but couldn't find anything that seemed to do the trick. Though, again, I couldn't interpret most of what I was reading at all, so that didn't help in the end.

    The games I want to make, at least my first ones, are all 3rd person... a puzzle game, a top-down auto scroller, etc.  The games that would be telling stories are considerably bigger and more complex action-adventure style, so I would need a lot more experience in programming, and game design/development in general, before I'm ready to tackle those. Only one of those bigger ones would actually be from first-person, heh.

    The first one is a kinda whimsical, tile-based puzzler.  No combat, no fancy moves.. just moving around tile-based levels with grid movement, and completing objectives. Maybe 4 or 5 "mechanics" tops. Looking into how to make a model move by pressing a key was intended to be the first step to learning how to do the grid-based movement.

     

    • Like 1
  14. Decided to look at some tutorials online, etc. I found one that sounded like it should be simple enough, but I'm just confused watching it.
     

    Here's what's confusing me...
    What are the "Script." and "self." for?
    I notice 'Script' is capitalized and 'self' isn't, but I don't know why that would be the case.
    Why does he use : in some spots, but . in others?

    And so on. 

    According to others "reading others' code is a great way to learn". It's only confusing me more, because I haven't seen anything in this video in any of the Lua tutorials I've seen. Only one that's similar is the Lua tutorial here that Josh linked in a previous reply. But then nothing I've learned in Lua itself helps me understand what I'm seeing here. This is the wall I keep running into.

    Beginning to think maybe I should just stick to "codeless" game engines, or just stick to environment stuff - though then I won't be able to convey or test ideas I have for games. 

    Ugh. 

    Again, this makes me super impressed by people who teach themselves. I've been trying to learn coding for a long time now, and I keep running into walls like this, where I encounter code or concepts that nothing I've learned up to that point helps me understand. So I end up wondering "am I just that thick?", "is there some chunk of important stuff I completely missed or overlooked?", "am I just incapable of absorbing this stuff?"

  15. Since posting that last comment, I found this video online:
    https://www.youtube.com/watch?v=zOjov-2OZ0E

    I think this might just be what's been missing. The video isn't language specific, which is probably a good thing for me at this point, as I'm learning the concepts, rather than worrying about learning specific syntax. It not only goes over what different things do and how they work, but it's using practical examples that I might use in an actual project to convey their use. It's not saying "a for loop lets you print "Hello World!" 100 times", and leaving it there. 

    I'm about half way through, and so far, it's all clicking in a way it didn't before, thanks to the more relatable examples and how they explain things in general.

    To someone already experienced, it's probably "there's absolutely nothing new or insightful here". If that's what is occurring to you (who ever happens to read this), I'd just ask you to remember you're looking at it as an experienced programmer, and all of that is 2nd nature, and "simple". For me, it's all still very new and I'm still absorbing it. Different people learn in different ways, and for me, it's all about having something explained with a context that I can relate to. That's when I get it. 

    So, we'll see how this all pans out.

    Just occurred to me this is starting to read like a personal blog lol. Sorry 'bout that 😛

    • Like 2
  16. 11 hours ago, Josh said:

    Lua is pretty darn simple. I don't think there's much beyond what is described in the Leadwerks tutorials.

     

    9 hours ago, Genebris said:

    If you understand functions, tables, variables and loops, you are ready to go. Lua is that simple. My advice is to read Leadwerks' default scripts and see how those concepts are used there along with Leadwerks API. Then you try to adapt example scripts to your needs. And after that you are ready to program everything yourself.

    I think that kinda goes into the area of what it's like for an experienced programmer, versus someone brand-new. I'm sure Lua's very simple, relative to other languages, for an experienced programmer. For someone just getting started, like myself, not so much. Learning the syntax, variables, loops, etc isn't the hard part. For me, it's figuring out what to use when. And it's where I feel almost every course or tutorial I find falls short. Everything is taught through memorization alone, rather than by practical example.

    For example...
    I decided my first task in LW would be to write a script that would simply move an object forward when I press W.  I went through the FPS player script, figuring I'd find a clue there, since it has that same functionality. Couldn't understand anything I was looking at. The Lua stuff was familiar - everything else was completely alien. Tried looking through the documentation, at the LW specific commands, etc.. Couldn't find anything that seemed like what I was looking for. Eventually concluded it's still too advanced for me. 

    So, that's where I'm at. Stuck at learning the syntax, but not knowing what to do with it, where/when to apply it.

    And I'm not even trying to become Mr. Super Coder. I just want to learn enough to create simple mechanics, or rough prototypes and such for my own projects. Proofs of concept, etc. Whatever it is that I should be doing to make it sink in keeps eluding me.

  17. 5 hours ago, Josh said:

    I think you will find that the new renderer makes even basic graphics look magically better.

    I'm seriously looking forward to diving in! I like all the screenshots and short clips you've shared so far. Much of the explanation goes over my head, but I get the general idea.

  18. 4 hours ago, Josh said:

    Yup! Gone through that a few times now. 
    It's very well done, but it's also very limited in scope - understandably. You're not trying to provide a complete Lua course here (though you'd probably do an excellent job of it, based on that tutorial).

    The other thing is, it's specific to LW, which adds more complexity into an already complex subject - and I'm trying to avoid that. I want to learn Lua itself, to understand the base language, so I can then expand out into something like LW and already have that foundation.

  19. Exactly so.

    I'm running into a similar problem with the Lua video I'm following. It's just going through a bunch of different things (variables, loops, etc) with random examples, then moving on to the next subject. There's no practical example or explanation given of when you'd want to use these things. 

    I honestly wonder how people manage to teach themselves programming with how many terrible courses/tutorials there are out there, whose creators don't seem to remember what it's like to be brand-new to it.

    • Like 1
  20. On 7/10/2022 at 1:33 AM, Josh said:

    @WSI Sometimes constraints enable creativity. Quake mapping is still going strong.

    Yes indeed! 

    My current idea is to stick purely to normal and specular maps in my projects. Keep it simple. And keep a more stylized look, rather than realism.

    In terms of realism, Zelda: Twilight Princess is right about where I like it. Probably a slightly higher poly count.

    legendzelda_1668473b.png

    • Like 1
  21. I found a video series on learning Lua. Just plain Lua, not Lua using Love2D, or Lua using Roblox, etc. Just Lua. I figure that's going to give me a better foundation and understanding of the language itself. Right now, I don't understand what I'm looking at when I look at a script in LW. Hopefully it'll help me better understand and learn when I start applying it to Leadwerks.

    My question is, what would be recommended glue to bring basic Lua together with Leadwerks? I assume there's going to be a lot of commands specific to Leadwerks. I noticed that when I looked at Love2D. I want to first learn and understand Lua by itself, not as colored by a specific engine. 

    Hope that makes sense.

  22. On 7/5/2022 at 11:28 AM, Josh said:

     

    @WSIIt does seem like people are tired of the same old thing and ready for something new. This definitely was not the case a few years ago.

    I know I'm an exception in this regard - and it's not me being "contrarian" in any way - but the more powerful and "realistic" the results get with modern game engines, the less interested I am. Is it impressive to see how far tech has come in such a relatively short time? Yes. Of course. It's crazy to watch something like Final Fantasy: Spirits Within / Advent Children, maybe even Avatar, and think "those could be rendered in real-time on some modern engines, and look even better"

    I'm still more moved seeing some really creatively made Quake 1 or Unreal 1 maps than I am anything in Unreal Engine 4, etc.

    My favorite era of 3D game graphics is around the late PS2/early PS3/GameCube era.  When it was still more about solid artwork carrying the look/feel of something, rather than how many pixel and vertex shaders were used to render it. Things were close enough to "realistic" to draw you in, while still leaving room for your imagination to fill in the rest. I'll play a PS2 or PS3 game, or watch someone streaming one, and think "wow this game is really beautiful...".  When I look at games made on modern engines, it's more "wow, this engine can render some realistic scenery". It's not the same effect.

    Bleeding-Edge 3D graphics tech ages and becomes outdated looking. Good art always looks good.

    That said, give me a game made on any game engine with beautiful art that draws me in and gets my imagination going, I won't care what game engine it is, I'll rave about it all day; far more than the most complex scene comprised of 3D scanned objects and people, rendered at a quadrillion tris per second.



    My two cents.

×
×
  • Create New...