• What are you working on? December 2011 Edition
    3,353 replies, posted
[QUOTE=Noth;33715722]I suppose I don't see why not. All I did was copy-paste the existing code into a "XNA Windows Library" project. Source and compiled DLL download: [url]http://www.teambps.net.au/Noth/UILib.zip[/url][/QUOTE] You're gonna have some issues with that. The code relies on some AssetManager stuff.
Speaking of consoles, I really love how easy a Google V8 implementation of a console usually winds up. [cpp]// Creates a new execution environment containing the built-in // functions. v8::Persistent<v8::Context> CreateShellContext() { // Create a template for the global object. v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); // Bind the global 'print' function to the C++ Print callback. global->Set(v8::String::New("print"), v8::FunctionTemplate::New(Print)); // Bind the global 'read' function to the C++ Read callback. global->Set(v8::String::New("read"), v8::FunctionTemplate::New(Read)); // Bind the global 'load' function to the C++ Load callback. global->Set(v8::String::New("load"), v8::FunctionTemplate::New(Load)); // Bind the 'quit' function global->Set(v8::String::New("quit"), v8::FunctionTemplate::New(Quit)); // Bind the 'version' function global->Set(v8::String::New("version"), v8::FunctionTemplate::New(Version)); return v8::Context::New(NULL, global); } // Executes a string within the current v8 context. bool ExecuteString(v8::Handle<v8::String> source, v8::Handle<v8::Value> name, bool print_result, bool report_exceptions) { v8::HandleScope handle_scope; v8::TryCatch try_catch; v8::Handle<v8::Script> script = v8::Script::Compile(source, name); if (script.IsEmpty()) { // Print errors that happened during compilation. if (report_exceptions) ReportException(&try_catch); return false; } else { v8::Handle<v8::Value> result = script->Run(); if (result.IsEmpty()) { assert(try_catch.HasCaught()); // Print errors that happened during execution. if (report_exceptions) ReportException(&try_catch); return false; } else { assert(!try_catch.HasCaught()); if (print_result && !result->IsUndefined()) { // If all went well and the result wasn't undefined then print // the returned value. v8::String::Utf8Value str(result); const char* cstr = ToCString(str); printf("%s\n", cstr); } return true; } } } // The callback that is invoked by v8 whenever the JavaScript 'print' // function is called. Prints its arguments on stdout separated by // spaces and ending with a newline. v8::Handle<v8::Value> Print(const v8::Arguments& args) { bool first = true; for (int i = 0; i < args.Length(); i++) { v8::HandleScope handle_scope; if (first) { first = false; } else { printf(" "); } v8::String::Utf8Value str(args[i]); const char* cstr = ToCString(str); printf("%s", cstr); } printf("\n"); fflush(stdout); return v8::Undefined(); }[/cpp] I remember using something like this in a pet project I was working on.. But being me, it involved a shit-ton of needless macros and templates of course. Javascript (or ECMA-Script to be precise) is beautiful when embedded in games, especially when used in conjunction with JSON for definitions, maps, config files and the such. I prefer it over Lua for some reason.
[QUOTE=voodooattack;33717323]Javascript (or ECMA-Script to be precise) is beautiful when embedded in games, especially when used in conjunction with JSON for definitions, maps, config files and the such. I prefer it over Lua for some reason.[/QUOTE] I found the prototype-based OOP to be somewhat incompatible with games when I tried using it, I wished I'd gone with Squirrel or something after a few days of using V8
[QUOTE=simie;33717698]I found the prototype-based OOP to be somewhat incompatible with games when I tried using it, I wished I'd gone with Squirrel or something after a few days of using V8[/QUOTE] It really depends on how you design your game, prototype-based objects have their advantages as well as their caveats. For instance, you can have the fields, methods and properties of your game world, objects, and scripts statically defined at instantiation. Once the world is instantiated however, the scripts are free to change it as they please. As objects interact they could add new variables to their respective contexts or other objects, modify behaviours, or even add or replace some of their methods (effectively changing their own prototypes); but the process should be transparent to you as far as your program is concerned. This comes in handy when you implement serialisation and state-saving. Your environment can have a radically different structure from its initial state. There are disadvantages too, everything being prototype based means that there could be a big mush of clutter inside your environment, scripts may conflict and/or interfere with each other, overwrite fields, etc. But that can be controlled by some clever design tricks. (You can offer an object to a script and save any fields it changes to a local mirror of the object specific to the script, for example) In short: Things can go really good or really bad depending on how you design it. Such is the case with any programming approach really.
[img]http://i.imgur.com/LQlIH.png[/img] Tokenisation! Well, most of it. I spent about half an hour wondering why it seemed to be missing out the first token, finally realised that the printing was iterating from 1 instead of 0. Been using VB for too long :S [editline]14th December 2011[/editline] Also, feels nice not to have those ugly flat, square controls that VB somehow still manages to use.
What Visual Studio extensions do you guys (and wimmen) use? Just upgraded from Express.
Visual Assist X.
[QUOTE=Naarkie;33719235]What Visual Studio extensions do you guys (and wimmen) use? Just upgraded from Express.[/QUOTE] I saw this really cool debugging extension that used "bubbles" or something.
[QUOTE=Night-Eagle;33714492]Tezz unable to tess a polygon? We must remedy this poetic injustice! ...try an [b]ear-clipping algorithm.[/b] The other option is to use a sweep-line algorithm .[/QUOTE] [img]http://dl.dropbox.com/u/286964/Unity/ear-clipping.png[/img] [img]http://dl.dropbox.com/u/286964/Unity/earclip2.png[/img]
[QUOTE=Yogurt;33719304]I saw this really cool debugging extension that used "bubbles" or something.[/QUOTE] [url]http://msdn.microsoft.com/en-us/devlabs/hh227299[/url] One of those extensions that looks cool but you never really use.
[URL="http://msdn.microsoft.com/en-us/library/ms379578(v=vs.80).aspx"]Edit and Continue[/URL] My life has been changed.
[QUOTE=thelinx;33709084]How did you make it work for non-metro apps?[/QUOTE] Huh? Are you using the one that came with Win8 dev? Don't. Download the full Visual Studio 2011 Ultimate Developer Preview from Microsoft for free. [url]http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=27543[/url]
I'm gonna have another go at Andriod app development Last I attempted I just ragequitted because the docs was annoying (some important info was buried goddamn deep), their tools didnt work (automatic project generation errored to shit, and I didnt want to make the entire Ant script myself) and the emulator was slow as fuck (it took 10 minutes to boot up on the first run, 3 minutes with the state saved, but it took 10 seconds just to slide a fucking menu over)
corona looks promising, lua in android sounds really cool, i'll give it a try maybe it's like löve for android
[QUOTE=Naarkie;33720030][URL="http://msdn.microsoft.com/en-us/library/ms379578(v=vs.80).aspx"]Edit and Continue[/URL] My life has been changed.[/QUOTE] Awesome, but somewhat limited: [quote]Some examples of such unsupported changes are: Changing the name of a class. Adding or removing method parameters. Adding public fields to a class. Adding or removing methods.[/quote] I'm not sure about something similar for .NET, but I can recommend every Java developer [url=http://zeroturnaround.com/jrebel/]JRebel[/url]. It supports all of the features listed above. I'm using it at work and it's so fucking handy. Especially because the application server takes about 30 seconds to shut down and 1 minute to redeploy and boot up again.
[QUOTE=Robber;33720408]That seems pretty limited: I'm not sure about .NET, but I can recommend every Java developer [url=http://zeroturnaround.com/jrebel/]JRebel[/url]. It supports all of the features listed above. I'm using it at work and it's so fucking handy. Especially because the application server takes about 30 seconds to shut down and 1 minute to redeploy and boot up again.[/QUOTE] I was linking that for thelinx because of improved C++ intellisence. Not .NET stuff. Also, anything this doesn't support, VS10 doesn't support. Besides some third party addons and other beta related bugs.
[QUOTE=Naarkie;33720030][URL="http://msdn.microsoft.com/en-us/library/ms379578(v=vs.80).aspx"]Edit and Continue[/URL] My life has been changed.[/QUOTE] I'm a huge fan of this, though it's less useful for initialization. Best for every-frame events or action-driven events.
Edit/Continue is complete crap in VS. Doesn't work half the time. Honestly without something like JRebel its better to just setup unit tests.
[QUOTE=DeadKiller987;33720477]I was linking that for thelinx because of improved C++ intellisence. Not .NET stuff. Also, anything this doesn't support, VS10 doesn't support. Besides some third party addons and other beta related bugs.[/QUOTE] Oh fuck, sorry, I meant to quote the post above yours.
Got my code building a syntax tree from text input, but every time I try to touch the tree afterwards I get a segfault. Huh.
[QUOTE=slime73;33711553]"hello world" of game networking! enet is pretty awesome.[/QUOTE] What's that font in the text editor in the background :v:
Actually, it segfaults while it's building the tree. The call stack is empty, apart from some Windows dll, so I have no idea when it's happening. Hmm. [editline]14th December 2011[/editline] Nevermind, splattered my code with breakpoints, found what I was doing wrong. It was actually an exception I'd thrown myself, not sure why it was showing as a segfault but oh well :v:
This is far from being the result I was looking for :v: [img]http://i40.tinypic.com/2upz8eu.png[/img]
[QUOTE=HiredK;33721442]This is far from being the result I was looking for :v: [img]http://i40.tinypic.com/2upz8eu.png[/img][/QUOTE] Saturating at all? You should for vars that could be > 1 or < 0.
[QUOTE=Yogurt;33717158]You're gonna have some issues with that. The code relies on some AssetManager stuff.[/QUOTE] Haven't had any issues with it so far
Worked some more on my galaxy generator, now has maps of the world you have selected, still working on it; [img]http://i56.tinypic.com/ibb603.png[/img] Everything is consistent and the same at each run. No data about the planets is stored.
[QUOTE=Legend286;33721560]Saturating at all? You should for vars that could be > 1 or < 0.[/QUOTE] Actually it's just the output of [I]vec4(vec3(position_in_view_space), depth) * invProjMatrix[/I] displayed in a fbo... it was entirely accidental :v:
[QUOTE=r0b0tsquid;33718942]Also, feels nice not to have those ugly flat, square controls that VB somehow still manages to use.[/QUOTE] It's the default style. See [url=http://msdn.microsoft.com/en-us/library/system.windows.forms.application.enablevisualstyles.aspx]this[/url].
Another awesome bug :v: [img]http://i44.tinypic.com/29pdjxl.png[/img]
[QUOTE=Perl;33721011]What's that font in the text editor in the background :v:[/QUOTE] Monaco 11pt I think.
Sorry, you need to Log In to post a reply to this thread.