GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - This And That (unfocused randomness) Page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
View previous topic :: View next topic  
Author Message
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Sun Aug 17, 2014 9:48 am    Post subject: Reply with quote

Yay, the Chrome debugging and profiling tools are really advanced and no less useful than what I am used to from classic IDEs.

Alex wrote:
I need to learn how to do this type of timing thing. I never really understood how this type of thing works.
An analogy: For simplicity, let there be a house with a single room and a single window in it. Inside the house, some action is going on, a person is running back and forth and performing all kinds of tasks along the way (feeding the cats and birds, doing the laundry, dishes and whatnot).

In realities which behave like in Test 3 and 3b above, the person is only running and acting when someone is watching through the window but it wants to appear to have been running and acting all the time, even when no one was watching, so as soon as someone watches, it has to be really fast to instantly run into the position where it would be expected and instantly perform all the tasks that it should have been doing while no one was watching and all the objects it touched must appear like it really already happened, cats and birds must appear full, laundry hanging for drying and dishes put away already.

In realities which behave like in Test 3c, the person is running back and forth and doing tasks even when no one is watching. So when someone starts or resumes watching through the window, the person is already where it is supposed to be and all the tasks are already done as expected.

And in the browser world?: requestAnimationFrame will call a function(which we define) for us and that function to speak in the analogy should tell the eyes of the one watching through the window of the house what it sees at the time it is called, no more, no less, it should not (and can not be, since it's not called when we are not watching) be responsible for making the person inside the house run around and do tasks.

The person in the house running around doing tasks is like the game/simulation logic. It has to run, always (unless the game can be paused of course). The canvas is merely the window to the house through which we can peek at any time to see what the person in the house is currently doing and to see all the effects of what it has been doing while we were not looking.

I prefer having a fixed number of simulation steps per second independet of the view because that makes timing much easier than doing time-delta updates which might have to catch up on hundreds of steps in a worst case scenario and that may be impossible to do when simulation updates become increasingly complex and costly to calculate.

So... after all this testing I am sure, requestAnimationFrame is not suitable for providing the timing of game/simulation logic updates and it is meant only for updating the view to the simulation/game state.

Alex wrote:
the one downside to workers is the same-origin policy which makes it unable to work offline in chrome unless you customize how chrome runs
Fortunately that is easy to accomplish by running chrome with a command-line switch. In FireFox and IE it just works. The inlined Worker seems like an interesting idea though, especially when thinking about zipping up a HTML5/JS application which users can download and run locally without bundling an extra browser with it.

PoV wrote:
A separate setInterval "thread" is prone to a different kind of desync problem. Not sure about the Web Worker thing, but at least you're utilizing another idle CPU core.
I think it is pretty safe for now and it currently seems to be the only way to keep updating the logic while no one is watching. Of course, if I ever run into problems with that, I will rant about it here. :)
_________________
0xDB
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Aug 17, 2014 10:31 am    Post subject: Reply with quote

Quote:
[setInternval is] the only way to keep updating the logic while no one is watching

Yes, that is a fact. For multiplayer especially, you can't just stop doing anything when focus is lost.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Sun Aug 17, 2014 11:26 am    Post subject: Reply with quote

Whoa! This doesn't solve any of the problems we're talking about, but I have to share:


Firefox 31 has an integrated canvas debugger in early beta. It's disabled by default, but you can enable it by visiting about:config and setting devtools.canvasdebugger.enabled to true.

It's pretty sweet. Has a scrubber so you can step forward and back on each draw operation from a frame.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Alex
Developer

Joined: 05 Sep 2005
Posts: 1159

PostPosted: Sun Aug 17, 2014 1:50 pm    Post subject: Reply with quote

okay so if I understand correctly.. there's code that manages what everything is doing, and this code gets run as fast as possible, and at the same time, there is this requestanimationframe that prevents any drawing from happening during that process, and only does it at a set interval?
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Sun Aug 17, 2014 10:57 pm    Post subject: Reply with quote

Alex wrote:
okay so if I understand correctly.. there's code that manages what everything is doing, and this code gets run as fast as possible, and at the same time, there is this requestanimationframe that prevents any drawing from happening during that process, and only does it at a set interval?
Not "as fast as possible (*)" but ideally at the exact same speed on every machine it is running on, so it should be synced to a fixed number of logic steps per second. Example: With 50 logic steps per second, an object moving with a speed of 0.5 pixels per step, the object would move a distance of 25 pixels per second. With "as fast as possible" on the other hand, the object might move a larger or smaller distance, depending on the number of logic steps the machine running them manages to complete within a second.

The logic steps should also be distributed evenly across that second, which is why it is important to run them with a fixed interval, otherwise, it might happen that the machine is too fast and completes all the steps before the second ends, displacing the object in the above example by 25 pixels too soon and then it rests there until the next 50 steps are performed in the next second. So, if we would constantly look at a graphic representation of that gamestate, we would see the object appearing at different spots, each 25 pixels away from each other but we would not see it move steadily from one spot to the next.

Another example where this is important is timing of user input: Imagine a fast paced multi-player game where quick reaction at the exact right moment is critical to a win/lose situation. Now imagine the game runs 10 input checks per second on machine A and maybe 20 or 40 input checks per second on machine B. The player on machine B has a finer control over their player in that case and that would be unfair. Or even if the game is a single-player game and it's only possible to reach high scores by quick reactions at the right time, the player on machine B would still have an advantage.

(*) the calculations for a single logic step should complete as fast as possible though

PoV wrote:
Firefox 31 has an integrated canvas debugger in early beta. It's disabled by default, but you can enable it by visiting about:config and setting devtools.canvasdebugger.enabled to true.
Cool stuff.
_________________
0xDB
View user's profile Send private message Visit poster's website
Alex
Developer

Joined: 05 Sep 2005
Posts: 1159

PostPosted: Sun Aug 17, 2014 11:21 pm    Post subject: Reply with quote

Okay, that makes sense. I must be over-thinking it. One thing I've never figure out how to do in the past when coding a game is predict collisions for example if something is traveling a certain speed and overshoots the collidable area. Maybe that's unrelated to this sort of thing, I'm not sure. Sorry if I sound confusing, I should just focus on my strengths :P
It's pretty amazing the things you people do, I can't help but be curious.
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Sun Aug 17, 2014 11:43 pm    Post subject: Reply with quote

It's good to be curious. Artists can learn anything if they put their mind to it. Your Pixel Editor shows you've got your synapses in all the right places to do the thinking required to understand games and software development.

Collision detection for fast moving objects can become complicated, especially if there are many objects flying around and then, they might even change direction, rotation and whatnot while they move around which is why time-delta based logic step calculations can become much more complicated to do than doing a steady number of small fixed interval based steps.

For fast travelling object collision detection, I think the easiest way to prevent any "tunneling through objects" is to break down the stepping inside a logic update and basing it on the size of the smallest object in the scene and the speed of the fastest object in the scene. Example: smallest object may have a minimum width of 4.0 units across its body in any arbitrary traversal and the fastest moving object is moving at a speed of 100.0 units per step. In that example I would simply break down the single logic step update into 100.0/4.0 = 25 sub-steps, making every object move only a 1/25th of its real speed per sub-step and do collision detection in each sub-step.

There may of course be mathematically more sophisticated (and more complicated) ways of doing it.
_________________
0xDB
View user's profile Send private message Visit poster's website
Alex
Developer

Joined: 05 Sep 2005
Posts: 1159

PostPosted: Mon Aug 18, 2014 12:09 am    Post subject: Reply with quote

Okay, cool.. so basically it's kind of zooming in spreading things out a bit and checking each potential location the collisions could occur at- if it find a collisions, handle it, etc, and it'll still be synced with everything else because everything exits at the same overall step. Sounds like extra work, but I suppose that's necessary if it needs extra precision. All of it should go as fast as possible so as to not affect the framerate, and itll just wait for the next frame to do it all again, if I understand correctly.
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Aug 18, 2014 12:16 am    Post subject: Reply with quote

Ya, I've always liked "don't move faster than the smallest object" as an effective cheat. If you can make it no faster than half the smallest object, that's even better. Then you just need to detect each contact, and come up with a rule for resolving it (such as a 50% of penetration distance push away each about the line between centers).
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Will
Member

Joined: 28 Nov 2013
Posts: 60
Location: California
PostPosted: Mon Aug 18, 2014 3:09 am    Post subject: Reply with quote

I usually cheat and use middleware. The big engines usually support a real continuous algorithm, and its sometimes better to use raycasts, anyway.

If I'm writing my own, not only for better collisions, but also for a more accurate simulation, I usually divide the integrations up over the timestep, ie, integrating 1/8th the velocity of an object 8 times in the timestep. If it's going fast enough to tunnel after that... there's probably something wrong. I remember Box2DAS3 having parameter for that sort of thing in the World.step function.
As for solving collisions, with axis-aligned boxes I just separate along the shortest orthogonal axis, as I still haven't bothered to implement real restitution. There's some fancier math involved with true polygonal separating axis theorem (mostly dot products), but I usually don't need that.
_________________
Parents of young organic life forms are warned that towels can be harmful, if swallowed in large quantities.
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Mon Aug 18, 2014 3:26 am    Post subject: Reply with quote

In other news, I've decided to call my framework the Refugee Lib. I always wanted a RL but I never seem to get around to it. ;) :P
_________________
0xDB
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Mon Aug 18, 2014 5:43 am    Post subject: Reply with quote

A long time ago (back when I was doing Gameboy Advance dev), I named my library Rebel. I'll be honest, I'm not sure what it was rebelling against, but it had macros for bitfields (i.e. b00100111). :)
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Mon Aug 18, 2014 4:19 pm    Post subject: Reply with quote

Btw, endless loops don't work in Javascript, since it's single threaded. You need to yield to the UI thread as much as possible, so you don't crash people's browsers.

I saw you mention endless loops somewhere, thought I'd pop in and state that.


I'm actually quite versed in the nitty gritty details of Javascript, anyone interested in a thread on that?
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Mon Aug 18, 2014 11:44 pm    Post subject: Reply with quote

I did not mean a literally endless loop, just conceptually "endless" in a way that it is something that gets to run repeatedly (with control mechanisms slapped on to it, so it can pause and resume).

My progress in the last two days has been slow as I realized my understanding of the javascript core language semantics was insufficient to do anything more advanced than writing simple C-style functions and calling them. So I spend quite a bit of time, reading up on core language concepts, so I can write my code in a better structured way early on (also so I can understand 3rd-party code better since many things in javascript really do not seem to be as intuitive as they should be which is because semantics of some higher level concepts depend a lot on context where other languages use more (verbose and intuitive) keywords to make themselves clear).

Not a big deal of course, once the head gets used to it but I feel it is more important in javascript to really understand semantics to know what some code does than it is in other languages which can often be read and understood intuitively without knowing too many of the finer details.

I had to bend and twist my brain a bit to understand how to do nice conceptually object oriented programming in javascript which is a bit odd as almost everything in javascript is an object, even functions are objects, even prototypes(classes) are objects. There are a few builtin types which are considered values instead of objects which is important for passing parameters around, as values are (as in other languages) passed-by-value-copy and objects are (also as in other languages) passed-by-reference.

Depending on how I will structure my code, things can become either really complicated (mind bending to read) or really simple and straightforward. :D

Gil wrote:
I'm actually quite versed in the nitty gritty details of Javascript
That is good to know. I will bug you with questions should I run out of ideas. I've got one already: How do I implement something like a "private static(C++)" variable in a javascript class/prototype? It is a kind of variable which belongs to the class (not the instances of it) and can be manipulated only by the class methods itself, not from outside code. I found out how to make "public static" but private static... that seems to be a real head scratcher.

PoV wrote:
I named my library Rebel. I'll be honest, I'm not sure what it was rebelling against, but it had macros for bitfields (i.e. b00100111). :)
Game development rebels hang out/hide in the game developers refuge. I remember implementing bitfield macros looking like that at some point as well, I do not remember where and whatfor though... I think it was for j0rb a few years ago when I had to write some obscure CAPI/TAPI crap. Note to mind: You want to forget about that. Stay in the present.
_________________
0xDB
View user's profile Send private message Visit poster's website
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Tue Aug 19, 2014 7:26 am    Post subject: Reply with quote

Hmm, quick primer on prototypal inheritance seems to be what you need. I'll explain the nitty gritty, but feel free to skip over it, I'll link some examples of people that have done the work for you at the end.

Basically, prototypal inheritance is more powerful than OO, but as you noted, there's less clear syntax to deal with it (next version of Javascript will fix a lot of the gaps). You can easily create the classic class model in Javascript, so I assume you want to do that (I'll give you another option at the end).

To have simple OO inheritance, you need three things basically, delegation, state and private scope. Delegation is simple, just use prototypes. Any function in a prototype can be accessed by children of that prototype (as you know). You can use whatever you like, either a constructor function with "new" or Object.create. In terms of state, you can use mixins, but those are not provided by default in Javascript (most libraries call it "extend", $.extend, _.extend, etc). State needs to be copied over (called mixin usually), because state on a prototype is like a static variable, changing the prototype state from a child changes the state for all objects (makes sense). A better option is setting state in the constructor. It doesn't require a mixin and it gives you private scope, which brings us to the last point.

Private scope in Javascript is done with closures. If you declare a variable in a closure, you can write functions in that closure that access it, but it can't be accessed by anything outside of the closure. Example of a constructor function with private scope:
Code:
function Car() {
  var model = "Ford Model T";
  this.getModel = function() {
    return model;
  }
}


As for the articles:

John Resig's Simple Inheritance (supports super):
http://ejohn.org/blog/simple-javascript-inheritance/

Eric Leads' Prototypal Inheritance (MUST READ, for everyone ever wanting to do Javascript):
http://ericleads.com/2013/02/fluent-javascript-three-different-kinds-of-prototypal-oo/

Dennis wrote:
How do I implement something like a "private static(C++)" variable in a javascript class/prototype?.
Bit of a head scratcher indeed, but I know how to do it. If you post an example of what your OO looks like, I can show you how to integrate private static into it. I'll make you a JS-fiddle of private static in John Resig's version, but I need to go to the store first :)

Edit: this is how you do simple private static btw. Not the best method to do it, but it does the job:
http://coffeeonthekeyboard.com/javascript-private-static-members-part-2-218/
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Tue Aug 19, 2014 12:13 pm    Post subject: Reply with quote

Thanks Gil, I will have to read and try to understand all of that tomorrow.

Today I exhausted myself, getting this to work.
(not much to see except in the source, I am starting to understand some of finer details of javascript I think but I still keep shooting myself in the leg, so it took me all day to make that work as intended ^^)
_________________
0xDB
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Wed Aug 20, 2014 8:01 am    Post subject: Reply with quote

Wasted another entire day on refining and testing my OO approach and slowly beginning to grasp more javascript oddities. I am now using constructor functions in a way that allows me to even do multiple inheritance without getting a headache and it is as simple as calling the constructors of each "class" to inherit inside the "class" which inherits them.

The basic idea is that each object (re-)defines its own prototype in a factory function and the factory function at the same time serves as the constructor. This way, the constructor is in full control over which properties and methods can be inherited by other objects and it even controls if they are "inherited"(redefined on the new object itself) or if they are truly inherited(copied from the prototype). The one thing that truly baffled me in all the testing was that it really works and even the private state gets inherited correctly (while still being hidden from inheritors unless there is some accessor function to it provided).

I am not sure I am ever going to have a use for multiple inheritance though but getting this to work helped me a lot to get a deeper understanding "prototype based OO".

code: Test 3.d.r fucking with __proto__

I lost track of what I wanted to do next... ah no... I wanted to refactor Test 3c and frameworkify it to get rid of any Global state, so that, should I want to, could just have multiple "engines" running next to each other on the same HTML page.

Gil wrote:
To have simple OO inheritance, you need three things basically, delegation, state and private scope. Delegation is simple, just use prototypes. Any function in a prototype can be accessed by children of that prototype (as you know). You can use whatever you like, either a constructor function with "new" or Object.create. In terms of state, you can use mixins, but those are not provided by default in Javascript (most libraries call it "extend", $.extend, _.extend, etc). State needs to be copied over (called mixin usually), because state on a prototype is like a static variable, changing the prototype state from a child changes the state for all objects (makes sense). A better option is setting state in the constructor. It doesn't require a mixin and it gives you private scope, which brings us to the last point.

Private scope in Javascript is done with closures. If you declare a variable in a closure, you can write functions in that closure that access it, but it can't be accessed by anything outside of the closure.
That. Now I understand it(I hope). :D (and it only took two days of screwing around and double and triple checking values in the debugger and trying to break things deliberately(with great success) to make sure my code does what I think it would do)

Also "this" ... damn it took me a bit to realize that it's really not quite the same as "this" is in C++/C#/Java. It was really confusing when I used it without knowing for sure what it referred to.

Sometimes I still feel I need to know more language features or keep everything as simple as using only public properties and simple functions that operate on objects like that. Some sort of function based OO where each function takes the property collection (like a struct in C) as the first parameter and then fucks around with it as much as it wants without worrying about privacy.
_________________
0xDB
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Wed Aug 20, 2014 9:41 am    Post subject: Reply with quote

Woah, I should take a break. Checking my mood&activity diary of the past 6 days (including today) I spent 62 hours on the HTML5/JS topic (reading specs, testing and debugging) without having much code to show for it. Feeling quite exhausted and at the same time, anything unrelated to that (like sleeping, eating and chores) feels like an annoying interruption.

Good thing I am not doing this(developing software) as a j0rb anymore for it means I can take a break. Otherwise I would have to keep going tomorrow regardless of being out of energy.

Maybe I'll start playing Majora's Mask now.
_________________
0xDB
View user's profile Send private message Visit poster's website
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Wed Aug 20, 2014 8:36 pm    Post subject: Reply with quote

Dennis wrote:
Also "this" ... damn it took me a bit to realize that it's really not quite the same as "this" is in C++/C#/Java. It was really confusing when I used it without knowing for sure what it referred to.
After working with Javascript for the past year, I've slowly come to realize that "this" in C++/C#/Java is stunted, while "this" in Javascript is the proper way. A lot of times, you just want the stunted Java "this" though. I'm working on a cool library that should give you access to all these things in a more natural way.

The simple fix is this though:
Code:
function MyClass() {
  var self = this;

  self.method1 = function() {
    this.something = 12;
    self.prop = 93;
  };

  self.prop = 123;
  ...
}


This pattern makes it so there's always two variables to call upon, "this" and "self". "this" refers to the function context, "self" refers to the class (Java-style). "this" should always have preference if possible, so a function can be copied from one object to the next. Another fun pattern is this:

Code:
function MyClass() {
  var self = (this instanceof MyClass) ? this : Object.create(MyClass.prototype);

  ...

  return self;
}


This is a safeguard that makes sure that if you don't call the constructor with "new", it still works just fine. Another option is to just throw an error though, so you can actually fix subtle bugs like that.

Code:
if (!(this instanceof MyClass)) throw Error('Forgot to use "new" to instantiate object);

_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Thu Aug 21, 2014 2:00 am    Post subject: Reply with quote

Well, I can not safely use the "instanceof" test in my OO model. Why not?
Because instanceof relies on chaining prototypes like it is done in a classic Class based OO model (which does not support multiple inheritance).

In my OO model each object-constructor is in reality an object-constructor and at the same time a generator that creates a new prototype for the object being constructed.

This way, I can combine as many prototypes as I like in any constructor simply by calling the other constructors with the "this" object set explicitly from inside any other constructor (e.g. otherA.call(this); otherB.call(this); and so on).

The only drawback I can see to this approach is that all my objects only have the default Object prototype in their classic prototype-chain despite inheriting as many methods/properties from other prototypes (by including them in their own prototype directly) as they like.

So, if for example if I have an object x of prototype A which grabs methods from prototypes B and C, only x instanceof A will evaluate to true, despite A inheriting everything from B and C on its own prototype level. In a classic prototype-chain x instaceof B and x instanceof C would be true as well if for example the chain was A->B->C. In my OO model there is no chain. x can just do everything A,B and C objects can do but x itself at runtime so to speak does not know anymore where it inherited those methods and properties when it was instantiated.

First I thought this was a bug and a problem but trying to resolve it I found it is not really a bug but a by-design consequence of my OO model.

Back to "this" it means I just have to make sure when I write my code that I am being careful about understanding what it will refer to at run-time. I think I prefer having my scripts crash than trying to put in safeguards that might hide real bugs.

I am thinking of implementing something like an Array property on my base prototype though into which I will add type information from each constructor when it runs. I am not sure what benefits this would yield other than giving better debuggin information though, because at runtime, if I need to check whether some functions is available on an object I could just directly test if that functions is defined on it.
_________________
0xDB
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Thu Aug 21, 2014 2:11 am    Post subject: Reply with quote

And I am also thinking about dropping this kind of OO model completely but not do to classic Class based OO instead but to move over to something C-style based where I just have simple state-less functions which operate on whatever collection of properties is passed to them (manipulating them directly). So the first parameter to each function would be like a C-struct for the state to modify... but then again, that's kind of what "this" already provides. :P

So I think I will have a combination of both, writing my functions (detached from any specific prototype) and using "this" inside them and then my prototypes can hook up(by reference) to those functions as needed. Yeah, I think that's what I will do.
_________________
0xDB
View user's profile Send private message Visit poster's website
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Thu Aug 21, 2014 11:50 am    Post subject: Reply with quote

Yeah, using C-style state-less functions is better than using classical OO in a functional language, imo. I know how and when to use certain OO paradigms in Javascript, because I've been studying it for 5 years now, but I wouldn't recommend it for most people.

Especially people coming new from a classical OO background, trying to fit an OO model into Javascript is not the design pattern it should be, but more of a crutch, if that makes sense. Writing state-less functions is closer to the functional side of things and thus preferable over what I feel is like putting a square peg in a round hole.

That said, a combination like you propose seems excellent and is actually what most Javascript advocates, especially those running large teams, propose.
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Thu Aug 21, 2014 4:52 pm    Post subject: Reply with quote

Excellent, I'll go with that then.

And here is just some fun I needed to hack up after the boring theory of the past few days.

Test 3e: refactored/cleaned up some stuff

_________________
0xDB
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10892
Location: Canadia
PostPosted: Thu Aug 21, 2014 4:54 pm    Post subject: Reply with quote

C64 Palettel!!!!!
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1666
Location: Your consciousness.
PostPosted: Thu Aug 21, 2014 4:58 pm    Post subject: Reply with quote

YES!!!
_________________
0xDB
View user's profile Send private message Visit poster's website
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - This And That (unfocused randomness) Page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next

Use this link to get a Sign-On Bonus when you get started!

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.