-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
I don't mind the above at all, but I find it interesting that you're adding "types" to a language that has no types. My understanding is that you're doing this for the editor so it knows maybe what kind of control to display that certain exposed variable. In order to do that do you need types like Sound or Entity? Things like the 'choice style' make sense in what the needs would be for these variables, but why some of the other actual LE types like Sound or Entity? What else are you using that information towards? The reason I bring this up for discussion is because 1 of the reasons people find Lua easy is because you don't have to worry about types. I personally like types, but I've read and heard the lack of specific types for Lua is a benefit. Just curious if you've played around with other syntactical ways of exposing these variables and if this is the lesser of the evils? Is not having them being comments an option? Perhaps having us use a specific table name and putting them in there? Maybe having the first 3 characters of the variable name describe the display control type to the editor? Or having the table, assuming my previous comment of exposed variables being in a table at the top of each file, have subtables that describe the display control type for each variable. I'm curious because using comments like that is sort of misleading to the language itself. Someone just coming to LE but who has Lua experience might not realize that these comments at the top actually get converted to actual Lua variables where as if they were defined in a table at the top it would seem more obvious that these are now usable variables and that no trickery is being done behind the scenes. Just challenging things
-
Justify My Love (of Constructive Solid Geometry Modeling)
Rick commented on Josh's blog entry in Development Blog
You know what would be really cool. Having all those easy texture controls available to us via similar easy functions so we can do this stuff via code in the same easy fashion. -
You could make a 2D image that has transparency and just the edges are sort of red that fade towards the screen, then draw that over everything for a second or 2 when they get hit or something around those means.
-
I like this because he uses the same event styles I use. This is a very nice and clean way to do events. No polling! Button* pQuitButton= new Button( this ); pQuitButton->onPress.Add( this, &MyDerivedControl::OnQuit ); @Smash, could you package this up in a zip file and attach it to the post if possible? Just a little cleaner than scrapping the site. Big thanks for doing this!
-
I like reading blogs and Josh has been the only one spamming them recently (j/k I know we all love hearing about LE3) so I figure other people like reading blogs too. So I thought why not make one about what I'm working on. Over the last month or so I had pathfinding working using basically a 2D grid over a terrain using A*. Being able to move actors around like that just feels so inspiring and feels like the sky is the limit which what you can do with that. I had so much fun with just that alone. All along I was thinking about what could I make with this that wouldn't be to much to do for 1 person, would keep my attention, and would have some nice "replayability". I really wanted to make a tower defense game, but most of these are pretty meh. I recently got back into Age of Empires 3 and would build up a nice big army only to crush the AI (even on the hardest mode). Often I had to go to their base to even get somewhat of a challenge as they never came to me with anything of value, and pretty much never on multiple fronts. It wasn't satisfying for me at all. There was no challenge there. I like gathering resources (for some reason) and I like building up an army and placing them in strategic locations preparing for a big invasion and then having an "epic" battle. So that's the task I've set out to do. There won't be any "ages" or levels of progression. The game will be about the waves of enemies getting bigger and badder. You'll have some time between waves to manage your resources and prepare your armies for the next wave. Waves will start coming from multiple fronts. The music for each wave will get more intense and epic. The game will be about if you can survive all x number of waves. The setting is a medieval style so some of the units will be knights, assassins, wizards, and some towers. You'll have orcs tarus, undead, and other creatures with each wave. Also some mini "boss" of sorts mixed in for each wave. I have the pathfinding complete. When you start the game you place your "town hall" anywhere you want on the map. I have trees for wood, gold and stone mines. Still need to work on food like bushes and animals. Currently you can select your units and move them around the map and make them chop a tree for wood. I created a task system much like The Sims. When you give commands Tasks are pushed onto a queue for the Actor. Each Task includes the Actor doing it, the GameObject being done to (if there is one), and an Action doing the actual work. I have Actions like MoveTo & Chop. If I select an Actor and right click a tree, the game will find the closest open node to that tree, then push a MoveTo & a Chop passing the tree in question to that Actors queue and the actor will move to the location, then pop that task off, then start doing the chop. When the Chop tasks starts it registers itself to an OnResourceDepleted event from the ResourceProvider (tree) so when that tree no longer has any resources it notified all Actions working on it, which will inform the Actors indirectly to stop, or pop that task off. It works pretty slick and adding new actions that can be done is really fast, easy, and organized. Next on the plate: ============== 1. I don't want actor collision so they aren't considered in the pathfinding. However, when sent to gather a resources I want to spread them out around the resources so going to make an array for the grid of where villagers are. It'll be used when searching for the closest "open" node next to a resource when the user sends a villager to gather from that resource. Currently it finds the closest open node which means they all pretty much stack up on top of each other if they were all coming from the same general direction. 2. If a resource is depleted while gathering a villager will look for other resources in an AABB around it of the same resource type to just automatically MoveTo and start gathering to reduce the amount of micro managing requires for the villagers. 3. Basic UI in place so I can start making other buildings with resources by clicking on these buildings. So far going pretty strong with this game. Pathfinding makes all the difference with me. Seeing a game have some kind of life moving around is exciting.
-
Thanks NA. For now I think I'll just copy the models AABB and shrink it some on a per model basis and pass that new AABB to the ForEachEntityInAABBDo(). I got the placement code finished and able to move my 5 little villagers around the map! I'm finding programing RTS gameplay is pretty enjoyable.
-
Yeah I guess I was trying to kill 2 birds with 1 stone but you're probably right. I suppose I would have to create my own drawing debug method for these custom AABB's too so I can visually see them to make sure they look good. Thanks NA.
-
Forgot to confirm this. Thanks Daimour that worked. Anyone have ideas on the size of the bounding boxes? I would like to alter their size.
-
In the editor to see the AABB we have a "Show Boxes" check box. Is this only built into the editor or is there an engine command to get this also? Also there are 2 boxes. Yellow and blue. What box is the AABB and what is the other box? Also, how are these created and how can they be adjusted? I'd like to scale some bounding boxes down some since I'm using it for some collision type checks with ForEachEntityInAABB(). I could use extra bodies for these but if it's not to big of a hassle with AABB seems it would be easier than making extra bodies for all my models (since I don't want to use the actual shape of the model itself)). What I'm trying to get going here is placing buildings like in an RTS. I have a semi-transparent ghost of the building that I can move around with the mouse on the terrain. Because this is in the transparent world and all the trees are in the main world, I have a copy of this building in the main world which I show for AABB check and hide afterwards so it's not seen. This is all working great except the AABB for the trees are to big for this and therefore I can't place the building anywhere near trees. I feel like if I could scale down the AABB of the trees this would visually look better and let me place buildings closer to trees.
-
What Are Your Thoughts On Developing A Game Entirely In Lua
Rick replied to a topic in General Discussion
My experience from moving to Lua from C++ in LE: 1) Lua is more flexible in that I could freely pass and store functions all over the place without worrying about function signatures, which I found useful for "event" type driven stuff. You could also store different types in the same table which is both a blessing and a curse. 2) I feared making big changes to my Lua program because 1 typo and you could be hunting for hours/days given the current debugging situation in LE, which is not good. 3) Lua tables took some practice but once I got them figured out they were a joy to work with and you could get some pretty complex structures going. 4) Because simulating classes in Lua is sort of a hack to tables I generally just stuck with the procedural style of coding which I don't enjoy all that much. Coming from an OO language I often found myself missing working in that fashion. I do find myself back in C++ atm however, mainly because I feel it's more structured and organized which I like. From what I have seen, I think a game could easily be written all in Lua. -
Sorry was @Josh to get a feel for what he's thinking with this. Is this so we can create external applications that link into the editor? For example like a flowgraph or something of that nature?
-
What kind of plugins are you talking about here if not editor plugins?
-
Yeah, but I'm asking does MoveEntity() already do that for us inside itself. I seem to recall Josh saying that, but can't find any post about it. Maybe I dreamed it up, but just asking if anyone knows.
-
Does anyone know if MoveEntity takes time into consideration? In other words will it run the same speed on all PC's? I thought I remember Josh saying that it did at one point, but can't remember or find it.
-
Using table.insert in order to build an inventory system?
Rick replied to Pancakes's topic in Programming
@Pancakes, those are really "tables" not arrays. Note that you can use anything for the "index" or "key". It can be nice sometimes to use strings as the key, but you can even use another table if you want. The below link shows how you can sort tables in various different ways. http://lua-users.org...LibraryTutorial For an inventory I might look at using a string name of the item and the value could be the count (all depending on how you work your inventory though, stacking, splitting stacks, etc). inventory["wood"] = 50 for example When I'm working in Lua I almost always found it easier to use strings as the keys for many different things. Also, in Lua tables (or you calling them arrays) is basically how one works in Lua. Pretty much everything revolves around tables (array) so you are fine -
You know I'm seeing strange stuff too. I tried doing some picking just on the terrain. The first time everything works fine, but if I click again it errors out: if (LE.MouseHit(Mousebuttons.MOUSE_LEFT)) { TPick pick; if (LE.CameraPick(out pick, camera, new TVec3(LE.MouseX(), LE.MouseY(), 1000), 0, 0, null) == 1) { Console.WriteLine("(" + pick.X.ToString() + ", " + pick.Y.ToString() + ", " + pick.Z.ToString() + ")"); } } I have this inside a Game::Run method. I get the "object not set ..." error but it's on the 'this' function (which would be the Game class instance itself, which I'm inside of at this point. It's almost like while I'm inside Game::Run, the Game instance is getting GC or something. Very odd. [EDIT] Looks like I'm getting that same "possibly optimized away", error that you are getting. [EDIT2] Interestingly enough, not sure if you tried this, but if you just run the exe it works for me. So for sure just something with debugging. Give this a try. Still playing with it, but at least this will get the express edition more like pro. http://stackoverflow.com/questions/2812423/how-to-switch-between-debug-and-release-in-visual-c-sharp-2010-express/2938880#2938880
-
Easy solution. Switch to C++ Sorry mate, I have never seen that either so not sure what's going on. Looks like some kind of .NET thing happening there but I've never ran across that issue before.
-
Is it maybe being garbage collected somewhere along the way? Are you stepping through this code or just relying on the console messages? Would be interesting to step through line by line and after each line mouse over the builder.bunker variable to see when exactly it gets unallocated because that's what looks like is happening.
-
That is showing me builder.bunker.IsValid is failing. So I would say builder.bunker isn't valid. Not sure why you think it is valid. "is valid" doesn't get printed and the else clause doesn't get printed. That tells me it's failing on the if clause because either builder or bunker isn't created (that's what the object reference now set to an instance of an object generally means).
-
builder.bunker is valid? Seems to be the only thing that could go wrong if those Console.WriteLine's are showing valid values, unless your error is somewhere else after but I assume you've stepped through the code and see that it fails on the PositionEntity() line.
-
Sweet! I like tower defense games too. This should be fun.
-
OK, that seems like sort of what I was thinking then. When checking adjacent tiles if there is a wall on 1 edge just skip that adjacent tile (basically removing the link). I'll start giving that a go.
-
Has anyone done A* on a 2D grid where edges are considered being passable or not, not just entire nodes? Think original Sims where you build walls between nodes. If each node has 4 variables for edges that represent open/wall, when looking to consider if a neighbor node is walkable, would things still work if you check the current nodes 4 edges and if there is a wall there don't check that neighbor at all (this would assume the nodes share the edge value of wall). Has anyone done something like this before or the people who are more experienced in A* does this sound like it could work? If so I'll give it a shot for a small test I want to do.
-
I've been programming professionally for 10 years and I've never done proper unit testing. Believe it or not both jobs I've had (they weren't technical companies (retail & trading)) didn't do any formal unit testing. I think the fields programmers are in might have a big role in ones experience with this. I guess I'm doomed then, although I seem to make a pretty good living by coding "off the seat of my pants" and not doing proper unit testing (this is how the team I'm on works). What industries are you guys working in to give such luxury? The only thing my bosses care about is getting the programs done as fast as possible and it "basically" does what the verbal spec the business person gave us. Traders want their programs in hours not days/weeks/months.
-
My understanding of this, which I've never formally done this but only read about it, is that you are to create test cases that will fail your code AND you are to do these test cases BEFORE you even write the functional code in question. This seems very odd to me to even try and think in those terms, so was just wondering what people who have used this method think about it.