Jump to content
  • Advertisement

Iced_Eagle

Member
  • Content count

    221
  • Joined

  • Last visited

Community Reputation

349 Neutral

About Iced_Eagle

  • Rank
    Member
  1. Iced_Eagle

    VSync, Why would you turn it off?

    It's usually for when you are running below the monitor's refresh rate. With V-Sync off, you will get the image as soon as its rendered, which causes frame tearing. With it on, it has to wait until the monitor is done refreshing the image, which can sometimes give the illusion of being "slower".
  2. Iced_Eagle

    Check out my ray traced images

    Very nice! However, as others have said, there does seem to be some inaccuracies in one of your math functions. Did you write them yourself? Are they properly accounting for floating point error?
  3. Something that the Source engine does is that within each object, they say when they need to be updated next. For example, the TF2 turrets may only get updated every 60 ms or so instead of every frame (@60fps = 16ms) trying to look for a target. It's possible you could "miss" something using a model like this since logic can be delayed, but since you control when, it's up to you to ensure that it doesn't happen! Otherwise if you have active game objects, you will need to run update on them. You can make sure that the Update functions are as slim as possible, which leads me to my next suggestion that the Source engine does. Each object defines the think function that will be used. For example, going back to the TF2, it can have one function who is merely looking for a target. When it finds one, it reports that its new think function is "EngagingTarget" or whatever logic it should have. What the main benefit that this gives you is that for starters it separates logic out cleanly into their own functions. Second, it prevents a lot of if conditions to determine the state of the object to figure out what should happen. For example, the TF2 turret update could have one function that looks like this: void Update() { if(!IsBuilt()) Idle(); if(pTargetAcquired) EngageTarget(); else if(!pTargetAcquired) LookForTarget(); } However that's an extra layer of abstraction, and if run every frame can lead to slow down (especially if you have code like that which is run on a lot of objects, such as soldiers in an RTS game or something). As you can see, I think the way Source handles game logic is pretty interesting and provides nice benefits :)
  4. Anyone else have any thoughts? The LuaBind email list wasn't very helpful either, so I'm thinking of switching binding libraries...
  5. I changed the order so it loads the script, defines the func, and then runs it to no avail. I've even tried doing a vanilla "dostring" with also no results. I'm not sure that his final solution really works for me since I'm doing a global function and not using member functions with structs and classes (yet). : I just emailed the luabind group, so I'm hoping within a few days someone can give me something to try or look at! I wish I could do more debugging on my own, however since I'm not familiar with Lua, I'm not sure how the stack should look before/after it runs and such, and why the only "error" I get is the function prototype. Hell, I even thought that maybe the C++ name-mangling was an issue, but extern "C" didn't seem to help either!
  6. Hehe, I did a quick sanity check by looking online for info (LuaBind only says it's for 5.0 so I freaked for a second), but starting with their 0.8 release, it supports Lua 5.1... I'll try emailing the LuaBind email list and see if I can get any results or else I may switch to another binding library.
  7. I actually missed the luabind::open somehow (personally, I think LuaBind's documentation is fairly poor :\). I put that right after I init Lua and load the basic libs, but it still has no change (I did a full rebuild hoping it would work, but no dice and yes I made sure that everything is getting init'ed before I define the funcs or call the script :) ). Error message is still the same and when I debug the script, it still throws an assert, but nothing descriptive... *Edit* BTW, thanks for your help thus far :) I'm sure it will end up being something silly, but hopefully others in the future can read and learn from my mistakes!
  8. Well, from what I looked at with Luna, you have to have specific function signatures (returning ints and taking the lua stack IIRC?). With LuaBind, you don't have to change the signatures, but instead just have to define the functions (which makes it work better with an existing codebase IMO), which is where I might be screwing up somehow... I ran my project in Decoda (Lua IDE/Debugger) and it throws an exception when it tries to call that function, so there is definitely something wrong in setting up that function.
  9. I'm tasked with implementing Lua into an existing C++ codebase. I've looked at Luna, Luabind, and tolua++ and I thought that Luabind was the most appealing choice of binding Lua and C++. After getting LuaBind all set up to compile and run, I'm having trouble getting it to work in the most basic sense. I have a ScriptingManager open up a LuaState, which is held throughout the life of the game. Later, once an object is created, I bind a very basic test function to Lua. void testabc() { return; } luabind::module(gScriptManager->GetState()) [ luabind::def("testabc", &testabc) ]; Very basic, right? Well, I later have a script which merely has a function call to testabc, and is just as such: test.lua: testabc() This is the code that is supposed to run it, however I am getting an error code (supposedly a Yield from Lua). void ScriptingManager::Run(const char* script) { int ret = luaL_dofile(m_luaState, script); if(ret != 0) { if(!lua_isstring(m_luaState, lua_gettop(m_luaState))) { return; } std::string err = lua_tostring(m_luaState, lua_gettop(m_luaState)); lua_pop(m_luaState, 1); } } The return value I am getting is 1, however the error message is the following: Quote:void ð­ºtestabc() That's it. Nothing descriptive, but just the function itself it seems. Can anyone help figure out what the problem is? [Edited by - Iced_Eagle on July 28, 2009 2:58:24 PM]
  10. Iced_Eagle

    The last 2 years

    Nice work on getting a job there! I have a few friends there who I am hoping can get me a job after school. I live in Bellevue, so if you ever want to get together for a drink, let me know!
  11. Iced_Eagle

    Windows 7

    Quote:Original post by evolutional I'm too scared to install it. I have 32 bit vista, want to go to 64 bit win7, but don't want to risk trshing my lovely HP laptop I upgraded my moms machine actually since she was getting frustrated with Vista. The only trouble I ran into was finding an onboard sound card driver. The manufacturer for that is a bit lazy, and you have to go through a few hoops to find and install the driver (it's basically an XP driver that has been "fixed" to install on Vista/Win7, but it works perfectly fine).
  12. Iced_Eagle

    Voting

    #2 absolutely.
  13. Iced_Eagle

    mutable vs const_cast

    I've only had one instance where I've used mutable so far. I was programmin a hash table container, and I created a Find function. Obviously, a find function shouldn't change, so the method was marked as const, as expected. However, within that find function, I was keeping track of statistics, such as the number of probes I had to do. That data was for my own personal use as the author, and the client never even saw the change externally, and the interface was how it should be (marked const).
  14. Iced_Eagle

    off to the MVP Summit :-D

    Just curious, but what bar are you heading to? I live in Bellevue (quite literally across the street from the MS Visitors center) so I may know it.
  15. Iced_Eagle

    Multiplayer / sockets

    Look at the concept of serialization, it will help. :)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!