• Advertisement
Sign in to follow this  
  • entries
    18
  • comments
    24
  • views
    12834

Lua Part (LuaParts.MaxValue)

Sign in to follow this  

462 views

Integrating Lua scripting into my game didn't exactly turn out as exciting as I thought it would. It is pretty sweet to type cube:SetPosition(x, y, z) in the console, and actually have the cube move around on the screen though. I'm not feeling like detailing much of the implementation because I don't think its really anything special at this point. A decent starting point and something to refactor a bit later on, that's all. And that's good enough for now. I'll come back to this thought at the end.

Working with and thinking about interfaces between Lua and C++ did get me thinking again about my .Net WinForms gui. I had originally started that project with the intentions of it becoming a generic game editor using my C++ engine, but got quickly frustrated trying to abstract and generify everything.

In case you haven't noticed by now, I only program at home out of boredom and its usually fueled solely by the randomness of my creativity. I have a hard time sticking to one project for long enough to get as much work done on it as I would like to. Contributing to that even more lately is work is pretty demanding of my creativity and in the evenings, on a creative level, I feel much more like consuming (playing Fable 2) than producing.

When creativity does come, it's hard to keep it going for the weeks on end I would need completely implement a certain feature. I'm thinking about bringing back the .Net Winforms gui I had started, but making a few changes and gearing it more towards being just tool to help in development of my specific game, and gradually make it more generic over time. Maybe if I have some different options of things to work on I'll be more likely to actually work on one of them instead of thinking I'm tired of that maybe I'll start a new project...

I've also made a few rules for myself.
Rule #1: No more deleting everything and starting from scratch!
Rule #2: To facilitate not starting from scratch, don't try to make everything perfect in the first attempt. Its much easier to refactor than to start from scratch.

I'd be interested to hear if any of you guys have any rules you follow to keep yourselves on track with hobby projects.
Sign in to follow this  


4 Comments


Recommended Comments

My engine project has been going on for about 8 or 9 years now, and I ran into issues keeping motivated too. However, I would suggest that you should never throw out all the existing code - there will almost always be times when you go back and use old code for something else... Just make sure you comment the code well to ensure it is legible later on [grin].

Also keep in mind that this is a hobby, which is supposed to give you some enjoyment and be fun. If the process of developing is fun, then running multiple projects at the same time and moving back and forth is ok. If you find the final product more interesting then try to stick to one project until it is completed.

I have also found that if I give myself smaller sub-tasks to do to create a larger task, then its easier to stay motivated since you can more easily see your progress. That helps keep things progressing and you can see your results.

Share this comment


Link to comment
Wow, 8 or 9 years. Keep it up, your Heiroglyph project is one of the better resources for DirectX 11 code samples I've been able to find.

Share this comment


Link to comment
Quote:
Original post by Matt328
When creativity does come, it's hard to keep it going for the weeks on end I would need completely implement a certain feature.

A good way I've found to combat this is to completely design out the feature/idea on paper/word-processor. If I come up with an idea for a game, I try to sit down and write out as much as I can about it. Same goes for a feature/system; design it out, make notes on how it will interact with the rest of the engine, etc.

Quote:
Original post by Matt328
I've also made a few rules for myself.
Rule #1: No more deleting everything and starting from scratch!
Rule #2: To facilitate not starting from scratch, don't try to make everything perfect in the first attempt. Its much easier to refactor than to start from scratch.

These are both great rules; I've lost far too much time because I deleted everything to start from scratch and because I tried to make everything perfect on the first go.

My main rule, though, is design first, code later. Even if it's just a rough draft, it makes things much easier.

I would also suggest a notebook per-project. Say you come up with an idea for a game, grab a notebook and start writing. If you lose interest, put it aside and you can come back to it later; for now, just work on something else. Eventually you'll have expanded upon it enough to have a full game (even if it is small.) This is how I handle things; I have a 5 subject notebook (which I've titled Big Book of Ideas) and whenever I get a new idea I start writing in it. Then, whenever I go to have a cigarette or I'm just bored, I open it up to a random page and pick an idea to try to expand upon.

Share this comment


Link to comment
I used to totally scrap a project, now I only scrap components. As I build experience, this happens less and less.

I had integrated Lua several years back - it took some tweaking (generally following what Lucas Arts did), but I sort of gave up on Lua. I didn't care for the general syntax and lack of experts. I'm seriously thinking about bringing in Python though. My init code is done through XML, though I'd like to perform some math, variable sets, and loops, and I don't think hammering XML into a pseudo scripting language is the way to go.

For a work project, I used CliPP, a Boost Spirit based javascript interpreter. I had to tweak a -little- bit, but as we have a lot of ECMAScript ready developers (i.e. Flash), it seemed the natural path. (http://clipp.sourceforge.net/)

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement