scidave's Forum Posts

  • Well, I forgot the deadline on this too. I originally had planned on doing a 2-player online deathmatch or collaborative shooter....but I've run out of time. There is only chatting... so the "game" pretty much blows. Spent all my time on the plugin and I'll be gone for the next two weeks.

    However, since nobody else posted.. here is my entry..maybe I'll win by default!!!

    http://www.box.net/shared/dz9a082nu7pathet749j

    <img src="http://i52.tinypic.com/5a3wjk.png">

    Usage is pretty basic:

    Enter port, select host server.

    For clients:

    Enter port, name, IP address of server.

    Chat and move around a blank game surface...fun...graphics are just the ones I love for tuts from Danc.

  • I just ran into this error when my computer updated to service pack 1 (windows 7). I installed the older version and Lucid's Physics file and everything seems to be working well.

    How come the new Physics.csx file is so much larger than the old one (its over 1 MB larger)....?

  • Very easy. Adding text based online using PodSixNet would be as simple as taking the chat example and expanding it a little bit.

    The only part that isn't easy is initiating connections with your opponents. Right now you need a internet facing server (or you have to manually configure port forwarding on your computer).. it's not hard, but the module doesn't do it for you.

  • Since this is FREE software you can't expect immediate resolution to every obj that isn't fully supported across all hardware platforms. Maybe it is something unique about your webcam and the only way to troubleshoot it is to buy your laptop model or similar with exact webcam. Who here is going to pay $500+ dollars to get your laptop and test?

    Thus Python is a good workaround. And it is pretty easy, and you would gain a new skill. So I'd recommend given it a go.

    I do have a webcam in my computer, but am currently working on a Network plugin so I wouldn't be able to even start on anything for a couple months. Since we've only had one request I think for now Python is your best bet...as I don't feel there is a big demand right now for an update.

  • First of all, I'm 15. I know I'm still a kid, but don't compare me to a 12 year old.

    You misunderstood..I know you are 15. I meant there are younger kids on the forum...

    I didn't know it was offensive to anyone.

    Really it is not a big deal at all..and you have been cool about it so that is refreshing!

    Thanks for posting tutorials as it is nice to have people to give back versus just take info.

  • sqlite with Python has an executescript() function. The best the mysqldb has is a executemany() function (simple example below):

    cursor.executemany(

    """INSERT INTO breakfast (name, spam, eggs, sausage, price)

    VALUES (%s, %s, %s, %s, %s)""",

    [ ("Spam and Sausage Lover's Plate", 5, 1, 8, 7.95 ), ("Not So Much Spam Plate", 3, 2, 0, 3.95 ), ("Don't Wany ANY SPAM! Plate", 0, 4, 3, 5.95 ) ] )

    This link may be useful as well for showing more complexity:

    http://stackoverflow.com/questions/9747 ... xecutemany

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It is not whether it got to anybody or not... the tutorial as originally written was not welcome on the forums.. plain and simple. Its offensive just throwing up bad language for no point whatsoever, especially when you might have 10, 12 year olds, etc on the forum using your example to learn.

    The tutorial as rewritten is much better. Thanks! Maybe if you want to try out your "Insane" side then put that in a game.

  • Your example looks pretty, but it is not functional. You aren't actually storing your items anywhere, just placing them on the screen. Plus, you can still drop items on top of each other (drag your mouse off the screen while moving an object and then bring it back.....).

    Check out PixelRebirth's examples.

  • The language in the tutorial needs to be cleaned up. The popup on the second layout is lame because not only is it bad language, but it is wrong (you click anywhere other than the 3 buttons and it pops up) at least you could make it if they clicked in the "wrong" places....

    All that being said, the attempt is appreciated..just clean it up a little bit and maybe use a color other than red for your highlighting!

  • Also, Python may be an alternative. The standard library, starting with v2.6, supports threading/multiprocessing:

    http://docs.python.org/release/2.6.7/li ... ading.html

    http://docs.python.org/release/2.6.7/li ... ssing.html

    I wasn't able to get either threading or multiprocessing to fully work with Python. For some reason, I can't seem to populate the entire Construct array inside the thread (only the first element). It is like it runs the loop once then just stops.... also can't set globalvars from inside the thread, etc... For multiprocessing I get an error "AttributeError: 'module' object has no attribute 'argv'...perhaps related to running the program via the Construct IDE and not commandline.

  • Not only does this keep the app responding during the processing, but it also gives you the opportunity to update the screen with the progress. That's probably your best bet for the time being.

    Yeah, this does sound like the best solution overall. It is messy handling all the different Windows messages and it wouldn't update the screen. It can be done right, but isn't as simple as what I posted....

  • Hey Krush!

    I was annoyed by this as well when I was testing the Python calculation times as I got the not responding message and thought Construct was frozen.

    The problem is that Construct is not responding to Windows messages while in the calculation loop. You need some type of "Windows Pump", an action that can be called in the loop to look for and handle windows messages OR to spawn off the calculations in a separate worker thread.

    I think the worker thread solution would be better. Somebody would have to create a plugin that spawned off a thread that could run the calculations...not sure how hard that would be.

    The Windows Pump solution would be easier to implement in a Plugin, but not as efficient. You would need to create an action "Process messages" that would have code like:

    void DoEvents()
    {
        MSG msg;
        long sts;
        do {
        if (sts = PeekMessage(&msg, (HWND) NULL, 0, 0, PM_REMOVE)) {
                TranslateMessage(&msg);
                DispatchMessage(&msg);
            }
        } while (sts);
    }
    
    [/code:2xej045l]
    
    I probably could make a plugin like this pretty easily for testing, but the thread solution is better.
  • These might be useful as well:

    http://neil.fraser.name/software/lpt/

    http://blog.wensheng.com/2008/10/python ... ndows.html

    I did a lot of parallel port programming awhile back so would love to see something cool done through Construct.

  • I did a quick test and looks like Construct events are going to be ALOT faster. It doesn't surprise me because since we have to use a Construct array then you have to use the Construct call to populate the array and I don't see a way to use Numpy and Python tricks for performance speedup.

    Filled a 2000x2000 array with int 5.

    In Python:

    start = time.clock()
    for x in xrange(1,2000):
       for y in xrange(1,2000):
          Array.SetAtXY(x,y,5)
    end = time.clock()
    final = end -start
    Text.SetText("Final time: " + str(final)) 
    
    [/code:3cnb83ic]
    
    In Construct just use two named loops, the inside loop a subevent to the first.
    
    Basic Python w/ range(): 20.40
    Python w/ xrange(): 20.19
    Construct For Loop: 2.28
    
    I didn't bother to check the performance for Numpy array generation with a Python array, but either way 2.28 seconds is hard to beat.
  • As always I defer to ROJOhound for the hard problems..

    but if Python did integrate with Construct arrays, I would believe that it could potentially be a lot faster using the Numpy library which at its core is all C/C++. You can also inline C code inside a Python script using Numpy.

    http://www.scipy.org/PerformancePython

    Excerpt from the site for a speed comparison:

    Here are some timing results for a 500x500 grid for 100 iterations. Note that we also have a comparison of results of using the slow Python version along with Psyco.
    Type of solution
    Time taken (sec)
    Python (estimate)
    1500.0
    Python + Psyco (estimate)
    1138.0
    Python + NumPy Expression
    29.3
    Blitz
    9.5
    Inline
    4.3
    Fast Inline
    2.3
    Python/Fortran
    2.9
    Pyrex
    2.5
    Matlab (estimate)
    29.0
    Octave (estimate)
    60.0
    Pure C++
    2.16
    
    [/code:x96idh12] 
    
    My guess is right now they are not integrated enough, but I think it would be well worth it to add that support.