« first day (641 days earlier)      last day (4676 days later) » 
00:00 - 20:0020:00 - 00:00

20:03
@C++folks
1131
Q: What is the name of this operator: "-->"?

GManNickG Moderator Note: Please think carefully before providing another answer to this question. If your answer duplicates an existing answer, it will very likely be removed. After reading "Hidden Features and Dark Corners of C++/STL" on comp.lang.c++.moderated, I was completely surprised that ...

@Gajet Old! :P
C++ always seems to be surprising me with new methods of development...
@PaulManta new for me
std::cout << x-- > 0 ? "x was greater than 1" : "x was less than 2";
@TreDubZedd I suspect that's just going to print the value of x-- > 0.
@TreDubZedd compile error
20:06
See also: the ++> and -- <= operators
It's going to be interpreted as (std::cout << x-- > 0) ? "x was greater than 1" : "x was less than 2";, I think.
Pseudo-code. My apologies
I've just had an operator precedence bug that got me for two days
if (visible.mParts.back().mPoints.size() == 1 && visible.type & (OT_linestringcollection | OT_polygoncollection) != 0)
@TreDubZedd @PaulManta can you spot it?
@Gajet I'm looking at it. :)
I assume (without looking it up) that visible.type & (OT_linestringcollection | OT_polygoncollection) is not what you meant
20:11
just a little hint, that if statement always evaluates as false!
or rather, is what you meant...but that visible.type is being compared to zero
so (OT_linestringcollection | OT_polygoncollection) != 0 is evaluated first
exactly, and visible.type always contains some flags at it's second byte so it is never 1
now that I'm thinking it's pretty odd it always evaluated as false, sone there are some enums in that code which have 1 at their first bit.
but anyway I just keep banging my head against the wall when I found out what the problem was...
I was under the impression that anything non-zero evaluates to true. Is that not the case?
that's true, but true is always evaluated as 1 when you cast to int
ah, so it's always visible.type & 1
20:16
exactly, and I guess the first part was always false for all the enums which had true as their first bit
dont worry i'm still here :P
Looking at the operator precedence list, now....I find it odd that bitwise shifts are not at the same level of precedence as multiplication and division.
i have node installed with latest version :D
@Dave woot woot!
there should be something wrong with the man who designed that list, none of bitwise operators are where you assume them to be.
20:21
I have not quite worked out what "node" is really useful for... it is based on the Chrome JS engine, which is pretty efficient, on the other hand it's really a poor development environment... poor libs and lack of useful debugging, tool support etc
I mean who does a bitwise and between a value and a boolean(result of comparison)
no idea how i use it tho hehe
@Dave it is quite interesting, JS is not a really terrible language
yeh my host installed it but no idea if its running or wat etc
20:28
Node does not have an standard web server system, you have to run an instance
i should mention im a complete noob when it comes to servers
But of course you can use it for other protocols, such as game servers, which is quite interesting
good night everyone
good night @Gajet
@WilliamMindWorXMariager you didn't show up tonight either!
it's not my fault you are not here when I am...
20:29
But Node is quite a lot like Twisted, which has been around a lot longer and originally intended to write game servers
i only need it for some simple js functions in the backend
Maybe that's not the best way of doing it then
i cant use js on client
people will cheat
You say "some simple functions"
path finders
20:31
But surely it would be your entire game logic...
yeh :P i considered them simple i dunno why i used that word xD
things like path finders are back end to prevent people walking faster or places they shouldnt
What did the rest of your back-end use, and why would you not use that?
well i use ajax to call php scripts to get data from my database using mysql in php files
but i wanted to use js for my pathfinder as i already have it made in javascript
remaking it in php is a pain in the butt
I suppose you want some kind of service which you can ask "is point b reachable from point a in time t?"
So you could code that into a node.js server of some kind, then have your PHP talk to it
i was guna just send start position and make it find the path
then send the path it found back
to client JS which would use it to draw the npc's movement
21:00
i killed chat :(
@Dave Send position to the server, find path, send path to client?
Is that your idea?
yup
users will cheat the path finder if i leave it client side
Like @MarkR said, you can use node.js
i have it installed but clueless with what im doing with it
Well, how do you want to communicate with it?
Directly to node.js server or through your PHP server?
21:05
i dont know any thing about servers which is better?
Whichever is easier for you.
You could switch to node.js and have both the server and client written in JS
But then you'd have to rewrite those PHP scripts for javascript.
i've really got no idea what you're talking about - servers is something i have zero knowledge on except how to make a cron + upload scripts :P
my host had to install node.js for me cos i had no idea
ah
:(
i dont get how people learn this
You're making a multiplayer game, yet you have no idea how servers work?
21:12
ive never had to do this kinda stuff with a server before
ive hosted websites etc but none of that involves installing some kind of library like node.js
or having to worry about which server to use for communicate etc
Well, you'll be coding your own server now.
=/
The choice was about languages to use.
But why do you need a server?
What should it do?
For your game
well i use ajax to php scripts to grab data from my database. but i need things like game logic server side to prevent people editing the code in their browser
and as i already have some of the scripts in js done it was suggested i use node.js
i just went by what people suggested :P
Yes, node.js is good.
If you can rewrite your database scripts for node.js, you won't need PHP at all.
Have you managed to communicate between your game and node.js?
21:18
"database" scripts?
my database interaction is just mysql in php files at the moment
if i can rid of php that be good
no i aint worked out how to get them communicating
i basically have the latest version installed on my server n thats it so far.
Browser game, right?
yup
You should use websockets, then.
Take a look at socket.io
instead of node?
No, it is an extension for node
21:21
i thought socket io was for live stuff
like say a chat room
Shouldn't your game be live as well?
well for things like path finder - no. i was going to do a "send position" > "find path" > "send back result"
v.similiar to ajax
requests
I'm not really sure I understand your definition of live.
It doesn't have to be a two-way transmission with socket.io
If that's what's bothering you.
well once it sends position n gets the path returned it doesnt need to ask it to calculate again unless an event occurs
That depends on how you code your server, i.e. whether your going to check if the start/target position has changed.
In general
To do something like "send position" > "find path" > "send back result"
21:29
it will change but only on events by the user so i know when it changes rather needing to check if it changes at random
periodically checking wont be needed for it like u would a chat room normally
You send a packet (a message) from the client with position via server's listening channel
Server does its stuff
Server sends result in a new packet via client's listening channel.
@Dave Yes, that depends on your implementation
the game is based on placing buildings/paths
not some one walking on a map at free will like a rpg
is it worth keeping a channel open 24/7 if its event driven instead of opening and closing when an event occurs
I just spent two hours answering a question and just realize the guy as only one question in profile and never connected since months ....
@tigrou Don't feel bad, man. You did a good deed :)
@Dave The channels are open while the client is connected.
21:34
I do not remember the details, but there shouldn't be much traffic while idling
it seems pointless to leave it open if no data is being sent
But I do not think that is something you should concern yourself with, right now
Try it out. Get your client-server communication working.
im trying but i dont get it :P
Try examples first
Then back to your game
Is there anything specific your not getting?
ill check the example out first
21:38
One question about gamedev stack : is there any topic talking about personal game projects (non commercial) (just like there is a topic about good programming blogs) i search but found nothing and hesitate to create new question (feel out of scope). I will be interested to see what some of you have work on.
@tigrou I think those kinds of threads are frowned upon.
user4704
There isn't, and it wouldn't be on-topic
Hang around here
user4704
Indeed; watching this chat is a better way to get current information on things people are working on, because people will discuss their projects frequently
@Damir this part i don't get
To run the server, put the code into a file example.js and execute it with the node program:
i made the file
but how i run the node program =/
21:45
Do you have node on your computer?
my computer ?
or my server
On your own.
It might be easier to understand if you have full access
i have open node.exe
on windows 7 which is showing a console
is that what it means by node program
Yes, and you need to execute your script with it.
yeh look at their example: nodejs.org
on front page it don't say how u tell it where the script is on my server
21:49
Just a moment
Let me see how to do that on Windows
You could run node.exe path\to\script.js
From cmd
so just type the domain to it =/
Local path
local path from my computer ?
how is it even connecting to my server
Let's use your computer as a server for now
Ok?
ok hold on then let me put the js file on my desktop
not much happened
im guessing i did it wrong ?
21:57
Try running node.exe C:\DAve\...\script.js from cmd
how do i run the node from cmd?
A moment
"To run Node, open a Command Prompt and type node. "
Open cmd and try this
ok
it says cmd.exe - node
in the window header
guess that did something :P
is there no private messaging on gamedev
Nope, but we can open a separate room
22:20
this is an interesting convo for me to read
im going to move into networking for my game shortly
@JMRboosties We're talking more about setting up node.js now
Feel free to drop by if you're interested
@Damir oh, ok
thanks :)
23:01
@Gajet I have my computer on a 10/10 mbit connection, but I'm more than willing to let you use it for testing. :)
@WilliamMindWorXMariager Are you a magickan?
@Damir I only delve in the blackest of black magic, so that would be a yes.
23:41
just been asking on the JS chat n they said i shldnt use node @Damir
Well, I haven't used anything else for JS, so they might be right
What did they say?
well they said if the calculation takes some time itll cause a backlog
so if it takes 200ms to calculate then everything else has to wait
Hmmm
I thought node was capable of multithreading.
they said to just use xhr method
I think it was @thelinuxlich who mentioned vertx.io
On their site: Just spin up more instances:

vertx run server.js -instances 32

Vert.x will do the magic to ensure the requests are distributed amongst the instances:
23:48
you referring to my issue @tylerrrr07?
@tylerrrr07 This looks nice
@Dave yes
I know nothing about it but I glanced at their website when it was mentioned
I remembered that so I thought I would pull it up since it sounded relevant - though maybe its not? I don't know.
oh lol this is all new to me so im a bit AHHH at the moment
i knew i'd dread the network server stuff when the time came
@Gajet you about?
00:00 - 20:0020:00 - 00:00

« first day (641 days earlier)      last day (4676 days later) »