Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411500 Posts in 69373 Topics- by 58428 Members - Latest Member: shelton786

April 25, 2024, 11:32:53 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The happy programmer room
Pages: 1 ... 190 191 [192] 193 194 ... 279
Print
Author Topic: The happy programmer room  (Read 678415 times)
Sik
Level 10
*****


View Profile WWW
« Reply #3820 on: August 03, 2014, 08:22:44 AM »

Remember this?
http://forums.tigsource.com/index.php?topic=17308.msg1047640#msg1047640

Got the crosscompiler working. Got the crosscompiler working. And game works flawlessly. All that mess was worth it in the end! \o/ (even if I had to reverse engineer configures and makefiles to figure out what the libraries actually wanted because Google didn't want to cooperate)
Logged
Slader16
Level 8
***



View Profile
« Reply #3821 on: August 03, 2014, 09:21:27 AM »

Oh yeah, I meant indexes in strings Facepalm
I use arrays/lists all the time, I just never realized you could use indexes with a string before Tongue
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3822 on: August 22, 2014, 06:13:54 AM »

Had a spare hour so decided to implement the sound side of things in a prototyping side project accompanied by my good friend beer. Beer!
Got it loading and playing oggs in that time using sdl_mixer, and while the docs kinda sucked there's only so much to the API, so it was a quick re-aquaintance and then just straight coding to spec (the intended interface has been designed for a while, so it was really just a case of marching around and _doing it_). Bed time now.
Logged

oahda
Level 10
*****



View Profile
« Reply #3823 on: August 30, 2014, 01:48:35 PM »

For the first time in many, many months I've been happily programming for a whole day straight with almost no interruptions, like the merry (at least about programming – maybe not so much about everything else) 14-year-old I once used to be. From 09:00 till 22:30 or so. AMAZING FEELING. I hope this continues.

After successfully implementing my component system with AngelScript running on a C++ engine (don't worry – I make actual games in Unity too) the way I wanted it to work (sort of a mix between jQuery and Unity with some personal preferences and handy abbreviations that would make certain developers hate me for the obscurity tacked on, I guess), I took a bath watching an episode of Dr. Who, and I am so continuing the programming for an hour or two now before I go to bed. Tomorrow it's back to the Unity game!

squuueeeee
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #3824 on: August 30, 2014, 01:55:54 PM »

How are you liking angelscript? I'm approaching having to choose a scripting language for C++ soon. I was considering Chaiscript or maybe LUA so far.
Logged

oahda
Level 10
*****



View Profile
« Reply #3825 on: August 30, 2014, 02:08:12 PM »

How are you liking angelscript? I'm approaching having to choose a scripting language for C++ soon. I was considering Chaiscript or maybe LUA so far.

It's lovely! It's going to be a little less gritty than it truly allows for, tho, kind of like how the C# in Unity doesn't really ever require the full breadth of the language, what with the generally tiny classes for each script and the uniformity of the component system.

Mine doesn't work exactly the same way, but it's very similar. Instead of wrapping the functions in a class, one simply attaches a script to a component, which contains a couple of functions compliant with specific signatures needed for callbacks in the engine – so far, these all take either a constant or a non-constant reference to the component itself, depending on the intended context of the callback. For example, the draw callback doesn't allow for the component to be modified, as this is supposed to be done before the draw step, in the update callback.

So currently, a script in my system looks something like this:

Code:
void start(Component @t)
 {
    log("Starting " + t.key());
 }

void update(Component @t)
 {
    log("Updating " + t.key());
 }

void draw(const Component @t)
 {
    log("Drawing " + t.key());
 }

Callbacks to be added such as those for collisions detected will take different arguments, of course. For the sake of laziness and syntactic sugar, I've added a shorthand C as an alias/typedef for Component, so that would work too. Tongue

Code:
void start(C @t) { log("Starting " + t.key()); }

Anyway, AS looks a lot like C++ (the only surprise here is the @ sign), so it's a very smooth transition between engine and scripting, not only when it comes to syntax, but also the fact that classes and the like allow for almost, or truly, identical (depending on how gritty you get with the C++ version of the class) interfaces no matter if you're writing code to talk to a component engine-side or scripting-side.
Logged

Azure Lazuline
Level 2
**



View Profile WWW
« Reply #3826 on: August 30, 2014, 07:12:44 PM »

I'm a happy programmer because this topic is 256 pages
Logged

standardcombo
Level 8
***


><)))°>


View Profile
« Reply #3827 on: August 30, 2014, 09:30:47 PM »

^ yay  Corny Laugh
Logged

Eigen
Level 10
*****


Brobdingnagian ding dong


View Profile WWW
« Reply #3828 on: August 31, 2014, 08:59:16 AM »

In what world of 1-based indexes are we living in? I want out! Smiley
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #3829 on: August 31, 2014, 10:01:53 AM »

How are you liking angelscript? I'm approaching having to choose a scripting language for C++ soon. I was considering Chaiscript or maybe LUA so far.

It's lovely! It's going to be a little less gritty than it truly allows for, tho, kind of like how the C# in Unity doesn't really ever require the full breadth of the language, what with the generally tiny classes for each script and the uniformity of the component system.

Mine doesn't work exactly the same way, but it's very similar. Instead of wrapping the functions in a class, one simply attaches a script to a component, which contains a couple of functions compliant with specific signatures needed for callbacks in the engine – so far, these all take either a constant or a non-constant reference to the component itself, depending on the intended context of the callback. For example, the draw callback doesn't allow for the component to be modified, as this is supposed to be done before the draw step, in the update callback.

So currently, a script in my system looks something like this:

Code:
void start(Component @t)
 {
    log("Starting " + t.key());
 }

void update(Component @t)
 {
    log("Updating " + t.key());
 }

void draw(const Component @t)
 {
    log("Drawing " + t.key());
 }

Callbacks to be added such as those for collisions detected will take different arguments, of course. For the sake of laziness and syntactic sugar, I've added a shorthand C as an alias/typedef for Component, so that would work too. Tongue

Code:
void start(C @t) { log("Starting " + t.key()); }

Anyway, AS looks a lot like C++ (the only surprise here is the @ sign), so it's a very smooth transition between engine and scripting, not only when it comes to syntax, but also the fact that classes and the like allow for almost, or truly, identical (depending on how gritty you get with the C++ version of the class) interfaces no matter if you're writing code to talk to a component engine-side or scripting-side.

Sounds good. It's similarity to C is certainly what attracted me to it. I'm sort of on the border of my project needing more than just data to define some parts of the game. I'll give it a try.


Just bought Visual Assist X. Really makes some tedious things less tedious to do.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3830 on: August 31, 2014, 03:15:42 PM »

We used AS in KAG as well. Tips for getting the most out of it:
- don't use it everywhere and for everything, scripts aren't as fast as you might like them to be, especially in the case of AS. This is the main thing we did wrong in KAG wrt scripting and it's really hurt performance.
- if you have some generic dictionary thing per entity, store aggregates inside. This makes for fewer places to typo your string lookup and makes it perform much faster and results in much more readable code.
- use non-oo design wherever possible if you're planning on rebuilding scripts at runtime. Simple structures and functions that work on those structures are much easier to rebuild safely and generally easier to reason about too.

These will of course depend on your use case but something to keep in mind. This is after writing more than 30k lines of scripts for KAG, so hopefully it's general enough Smiley
In what world of 1-based indexes are we living in? I want out! Smiley
haha, this Smiley
Logged

Will Huxtable
Level 0
**



View Profile WWW
« Reply #3831 on: September 04, 2014, 06:57:44 AM »

I'm a happy programmer because this topic is 256 pages

Haha, I thought that just as I was opening it.

Well, I'm happy because I have recently got a Cellular Automata water system working. As well as a simple inventory. Mostly because everything seems to be going right as of present!
Logged
oahda
Level 10
*****



View Profile
« Reply #3832 on: September 05, 2014, 02:00:03 PM »

Having switched my old project from C++98 to C++11, I was able to change this nasty line:

Code:
const typename std::map<const String, Resource *>::iterator i(m_resources.find(key));

into this:

Code:
auto i(m_resources.find(key));

Geez. Also this:

Code:
m_resources.insert(std::pair<const String, Resource *>(key, r));

into this:

Code:
m_resources.insert({key, r});
« Last Edit: September 06, 2014, 12:04:57 AM by Prinsessa » Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3833 on: September 05, 2014, 04:16:24 PM »

Typedefs could help you there but yeah auto and initialiser lists are great!

I've recently stumbled across 2d esolangs properly (knew of befunge but hadn't explored), they're tickling my fancy Smiley lots of fun ideas, might design and implement my own some time.
Logged

standardcombo
Level 8
***


><)))°>


View Profile
« Reply #3834 on: September 06, 2014, 02:03:16 PM »

If you use the following structure

//*/
  Code A (active)
/*/
  Code B (inactive)
//*/

you can toggle between codes A and B by deleting the first '/'  Wink Try it out!
Logged

Sik
Level 10
*****


View Profile WWW
« Reply #3835 on: September 06, 2014, 02:17:00 PM »

That's so unintuitive I'd probably ban it from my codebases (and I'd expect the same happening in other codebases as well). Yes, I'm aware IDEs will dim the comments, but it's still not obvious how it's supposed to work.
Logged
indie11
Level 2
**


View Profile
« Reply #3836 on: September 07, 2014, 01:14:24 AM »

So i've been trying to get the super mario type jump and this is what i've done so far

https://dl.dropboxusercontent.com/u/70467204/Jap/Jap.html

what do you people think?

I also want to know that should the gravity  be applied on upward velocity when JUMP key is down?

Another thing is the variable jump is not always the same, should I use fixed time step instead of variable time step to overcome this issue?
« Last Edit: September 07, 2014, 03:46:20 AM by indie11 » Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #3837 on: September 07, 2014, 09:24:24 AM »

There's quite a few topics on Mario style jumps here if you go searching.  I haven't checked yours out (on mobile) but gravity is applied in Mario during jump press it is just reduced.
Logged
indie11
Level 2
**


View Profile
« Reply #3838 on: September 07, 2014, 11:36:29 AM »

There's quite a few topics on Mario style jumps here if you go searching.  I haven't checked yours out (on mobile) but gravity is applied in Mario during jump press it is just reduced.

thanks, here's the updated link:https://dl.dropboxusercontent.com/u/70467204/Jap/Jap.html

Let me know what you think about these:
- Mario Style jumping
- Wall sliding
- Wall Jumping
- Air Control

I want to give this super meat boy-ish physics and I just can't achieve that.

Thanks Smiley
Logged

Quarry
Level 10
*****


View Profile
« Reply #3839 on: September 07, 2014, 12:22:01 PM »

What seems to be wrong is the hold jump's feeling, try walljumping in the opposite direction and doing a long jump. It feels as if I was being pulled upwards at a constant velocity instead of a higher velocity. Along with that walls should only stick when you are moving towards them
Logged
Pages: 1 ... 190 191 [192] 193 194 ... 279
Print
Jump to:  

Theme orange-lt created by panic