Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

@13aha. your replying to your post. @9 is your post only.i am just joking.ok. i will look at that. thanks for your suggestion

URL: https://forum.audiogames.net/post/559715/#p559715




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: question about bgt network object

@13 Oh I know it's rampant. But I tried to do the right thing (see post 12), even though my understanding of the MIT license back then was even more rudimentary than it is now Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/559462/#p559462




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: question about bgt network object

@13 Oh I know it's rampant. But I tried to do the right thing (see post 12), even though my understanding of the MIT license back then was even more rudimentary than it is now Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/559462/#p559462




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: question about bgt network object

@9You are misunderstanding what I am saying.  TCP can run inside UDP, for one thing.There is a thing called IP for the internet protocol, which is like throwing a message in a bottle into the ocean and hoping it arrives.There is a thing called UDP for Unreliable Datagrap Protocol, which is exactly the same as IP plus a tiny bit to do with being friendly to routers and something that you can use without root access.TCP runs on top of IP, but can also run on top of UDP with a little bit of overhead if you want it to.  What TCP does is turns sending unreliable messages back and forth that may not arrive into reliable messages that do.  It also handles order, of course.When TCP connects, almost nothing happens that's not either on your machine or the server.  Sweeping several things under the rug, the routers and the internet cables and all that don't do anything special at all for TCP.  Connect and disconnect are just some special IP packets with retry logic.  Throw the UDP header on them and now you've got TCP over UDP.  Throw some more information on them and customize the algorithms and you've got Enet.You're thinking that a bunch of networking things are special when they're not, which is why I'm suggesting you find a book.  You can write your own TCP implementation, it's even a not uncommon learning project for people going into networking.@11No judgement.  If I judge you I have to go around judging a ton of other people because practically speaking literally everyone does this (see also any web site running a JS minifier).

URL: https://forum.audiogames.net/post/559456/#p559456




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: question about bgt network object

Apologies for the double post, but I wanted to follow up with some additional information.Looking into it a bit further, in the credits section of the BGT help file, ENet is mentioned. There is a link to the ENet project website, followed by a brief description of what ENet is. Below this description, it says:Note: For licensing information related to the ENet library, please see the website linked to above.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/559453/#p559453




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector


  


Re: question about bgt network object

BGT uses ENet. I had an email conversation with the author regarding the attribution requirement back in the day. The MIT license has a bit of a legal gray area regarding binary attribution, though most people seem to agree that it *does* require it. Nowadays I avoid the MIT license to be on the safe side. ENet is the only component that was part of BGT which uses the MIT license.Kind regards,Philip Bennefall

URL: https://forum.audiogames.net/post/559449/#p559449




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

@9i know how networking works. in many of the internet articals, i find UDP is connectionless protcall and in python sockets, we don't connect UDP. instead we directly send a packet to server.i know all that.and tcp is connection oriented protocall that a client ned to make a connection with server and comunicate.i know all that things. and i am doing sockets for networking in python. comparing to general UDP networking and python sockets its apsalutely matching, but bgt is not matching and there is connect method. any way, thankyou for  your replys.

URL: https://forum.audiogames.net/post/559442/#p559442




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: question about bgt network object

Ah. I see. That makes your question clearer.  I'd suggest reading RFC 793 which tells you how TCP works or, if you'd rather, finding any of the long list of "the basics of TCP" guides.  Googling TCP handshake may also be productive.  Broadly speaking UDP is a thin layer on top of IP, and reliable UDP with connection and disconnection and all that looks very much like TCP, just with the TCP-like packets inside UDP ones since you can't use IP directly and expect routers to let your custom protocol through.As we've told you before, you will get a lot out of finding a book on networking and reading it.  Any good networking resource will explain how TCP works, and once you understand that you understand how reliable UDP can work.

URL: https://forum.audiogames.net/post/559431/#p559431




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

@7no. i already know networking in python. i know tcp and UDP and how they works. i do this in python sockets. but when i am bored, i saw bgt's documentation just for not beeing bored. there i observed the connect and disconnect methods. but in main network chapter, they said bgt uses UDP. and there is connect and disconnect. i wondered and started thinking. as you know, google don't have much answers about bgt. so i posted it to you. thankyou so much for your reply

URL: https://forum.audiogames.net/post/559429/#p559429




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

oh. i don't wan't any of networking. but, i compared networking in general using UDP and networking in BGT in UDP. i found the difference. that's why i posted this to you to know your openions that's that. if i know the sinario or algorithm or the logic used by bgt connect method in it's networking object, i planned to implement it in python socketsthanks so much for your replys

URL: https://forum.audiogames.net/post/559429/#p559429




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: question about bgt network object

Writing a reliable UDP protocol from scratch can be done by someone talented at networking in a weekend and a basic google will find 10 options for you.

URL: https://forum.audiogames.net/post/559427/#p559427




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

@5yes. mey bee enet or mey bee not. as americranian said, mey bee bgt is using enet. because bgt also uses UDP but it's acting like TCP. not exactly but, all connect, disconnect methods.

URL: https://forum.audiogames.net/post/559422/#p559422




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector


  


Re: question about bgt network object

I'm not sure it's Enet.  Did Philip ever say that?  I also used to think it was, but Enet is either BSD or MIT, and I remember that Philip wanted to avoid those licenses.

URL: https://forum.audiogames.net/post/559413/#p559413




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

and that 4 topic with the same name, my wifi suddenly turned off after i cliecked on submit and after i clicked submit, the error occurred like no internet. then after my wifi came, i refreshed he page. when my wifi starts, for 5seconds, my wifi will run a bit slow i don't know why. and i refreshed the page 3 times and it got submited multiple times with error. osrry guys really

URL: https://forum.audiogames.net/post/559411/#p559411




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

oh yeah. i am femilior with c and c++

URL: https://forum.audiogames.net/post/559409/#p559409




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: question about bgt network object

I don't know why, but there were a lot of topics created with the exactly the same title, though most of them lead to an error page.To answer your question, BGT uses Enet under the hood. What I believe happens is Enet does magic behind the scenes to make UDP magically function like TCP. You can find more information as to how it works here, though you will need to at least be passingly familiar with C.

URL: https://forum.audiogames.net/post/559404/#p559404




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


Re: question about bgt network object

admins and moderators, please delete or close those 4tobics with same name. i din't mean spamming but suddenly power was gon and the i refreshed the page multiple times to post it. please sorry for the inconveenience please excuse me.

URL: https://forum.audiogames.net/post/559352/#p559352




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


question about bgt network object

2020-08-08 Thread AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector


  


question about bgt network object

hey all bgt users and programmer! i have a small question regarding bgt's network objectbgt's documentation of main network chapter wrote:Please note that BGT uses UDP for all of its network communication. Thus, for a server to be able to accept incoming connections on a particular port, this port must have been properly opened to allow incoming UDP traffic.if you see, they have said that bgt uses UDP for it's all networking.generally, we know that UDP is a connectionless protocall.if we see in python socket module, client don't connect to a server. instead, client directly send a data to the server and server will send back the data back to the correct client using the address from the received packet.this is how the networking in UDP works generally. also.but if BGT is using UDP for networking, then how wood it provide connect method in it's network object. think it provid, how wood the network connect to a UDP server. i think in connect method client send like like it's ID and server will save that unique ID some where. that is called connect in bgt. please note that it is not real. i am thinking like that. i am making this topic to know your openion.thanks in advance

URL: https://forum.audiogames.net/post/559347/#p559347




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: a liddle question about bgt

2019-11-15 Thread AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector


  


Re: a liddle question about bgt

if you make use of system dll's, yes. sure, but i don't know how BGT's dll support would be with that...

URL: https://forum.audiogames.net/post/476852/#p476852




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


a liddle question about bgt

2019-11-14 Thread AudioGames . net Forum — Developers room : omer via Audiogames-reflector


  


a liddle question about bgt

is it possible to give keyboard input to the program when the window is not focused?like if i want to do something like thisx is at the desktop and wants to silence the music, can we abel to do such a thing or we have to be at the game window to do tahtif there is such  a way, can someone explain?

URL: https://forum.audiogames.net/post/476545/#p476545




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector


  


Re: Question about bgt handles

Thank you to all for the information on pointers, passing by value versus reference, and everything in between. I just want to address one topic, that being creating copies of arrays.In java, we would write a for-loop that would iterate over both arrays and copy each element over to the other array. However, if we have an array of handles in bgt,, how would this be done? It seems that copying the handles to this new array would be pointless since the handles in the new array would still be referencing to the original object, since there would be two handles pointing to the same place. So, how would this work if you want an indipendent copy of the array?  Or am I totally misunderstanding? Thanks!

URL: https://forum.audiogames.net/post/413518/#p413518




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector


  


Re: Question about bgt handles

Thank you to all for the information on pointers, passing by value versus reference, and everything in between. I just want to address one topic, that being creating copies of arrays.In java, we would write a for-loop that would iterate over both arrays and copy each element over to the other array. However, if we have an array of handles in btg, how would this be done? It seems that copying the handles to this new array would be pointless since the handles in the new array would still be referencing to the original object, since they would be two handles pointing to the same place. So, how would this work? Or am I totally misunderstanding? Thanks!

URL: https://forum.audiogames.net/post/413518/#p413518




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector


  


Re: Question about bgt handles

Another thing to consider when using pass by value and pass by reference, is that of the nature of the call. Note: all code is in c++. I do not know bgt. I'm assuming that bgt has some equivalent as it is a distant derivative of C, but so apply this to bgt with a bit of salt. slow and unsafe.This is equivalent to a normal function call where all of the arguments passed into the function are copied. Any changes made to those variables are not reflected in the variables of the calling function.#include 
using namespace std;

void variableTest(int x, int y);

int main()
{
int x = 1;
int y = 2;

cout << x << ", " << y << endl;

variableTest(x, y);

cout << x << ", " << y << endl;

return 0;
}

int variableTest(int x, int y)
{
x += y;
y -= x;

cout << x << ", " << y << endl;
}slow and safe.This is adding a const qualifier to the variables you pass into the function. This is basically not use and virtually pointless because if you already are passing by value, the changes you make will not effect the original values. If you want the variables to be read-only however, be my guest.The following code probably wont work, as i'm trying to modify a constant variable, but that could be useful though if you were trying to minimize access and keeping grubby little fingers where they don't belong.#include 
using namespace std;

void variableTest(const int x, const int y);

int main()
{
int x = 1;
int y = 2;

cout << x << ", " << y << endl;

variableTest(x, y);

cout << x << ", " << y << endl;

return 0;
}

int variableTest(const int x, const int y)
{
x += y;
y -= x;

cout << x << ", " << y << endl;
}fast and unsafeThis is the most dangerous of the 4 options. If you pass by reference, the function can modify anything it wants to as it pertains to your variables. It is fast though. A pass by reference is basically pass by pointer. It copies 4 or 8 bytes (the size of a memory address depending on your operating system) instead of passing the class instance or object you have defined that is a  dozen or more bytes. copying dozens and dozens of bytes just to make a function call will slow your program down to a crawl.#include 
using namespace std;

void variableTest(int & x, int & y);

int main()
{
int x = 1;
int y = 2;

cout << x << ", " << y << endl;

variableTest(x, y);

cout << x << ", " << y << endl;

return 0;
}

int variableTest(int ^ x, int ^ y)
{
x += y;
y -= x;

cout << x << ", " << y << endl;
}fast and safe.The best of both worlds fast and safe is pass by constant reference. If you are still with me you can probably guess what this means. We get the speed and efficiency of pass by reference, but the function can not modify the variables. This is especially useful for operating system / API calls where you are getting data from the user or application program. You as the system level software or operating system have no right to modify the data you've been given. plus if they have given you a struct of of employee data that has several variables like name, id, and address, you would much rather be shuffling around pointers and not big bulky employee structs.#include 
using namespace std;

void variableTest(const int x, const int y);

int main()
{
int x = 1;
int y = 2;

cout << x << ", " << y << endl;

variableTest(x, y);

cout << x << ", " << y << endl;

return 0;
}

int variableTest(const int x, const int y)
{
x += y;
y -= x;

cout << x << ", " << y << endl;
}

URL: https://forum.audiogames.net/post/413464/#p413464




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector


  


Re: Question about bgt handles

Another thing to consider when using pass by value and pass by reference, is that of the nature of the call. Note: all code is in c++. I do not know bgt. I'm assuming that bgt has some equivalent as it is a distant derivative of C, but so apply this to bgt with a bit of salt. slow and unsafe.This is equivalent to a normal function call where all of the arguments passed into the function are copied. Any changes made to those variables are not reflected in the variables of the calling function./code]#include using namespace std;void variableTest(int x, int y);int main(){    int x = 1;    int y = 2;cout << x << ", " << y << endl;    variableTest(x, y);cout << x << ", " << y << endl;    return 0;}int variableTest(int x, int y){    x += y;    y -= x;cout << x << ", " << y << endl;}[\code]slow and safe.This is adding a const qualifier to the variables you pass into the function. This is basically not use and virtually pointless because if you already are passing by value, the changes you make will not effect the original values. If you want the variables to be read-only however, be my guest.The following code probably wont work, as i'm trying to modify a constant variable, but that could be useful though if you were trying to minimize access and keeping grubby little fingers where they don't belong./code]#include using namespace std;void variableTest(const int x, const int y);int main(){    int x = 1;    int y = 2;cout << x << ", " << y << endl;    variableTest(x, y);cout << x << ", " << y << endl;    return 0;}int variableTest(const int x, const int y){    x += y;    y -= x;cout << x << ", " << y << endl;}[\code]fast and unsafeThis is the most dangerous of the 4 options. If you pass by reference, the function can modify anything it wants to as it pertains to your variables. It is fast though. A pass by reference is basically pass by pointer. It copies 4 or 8 bytes (the size of a memory address depending on your operating system) instead of passing the class instance or object you have defined that is a  dozen or more bytes. copying dozens and dozens of bytes just to make a function call will slow your program down to a crawl./code]#include using namespace std;void variableTest(int & x, int & y);int main(){    int x = 1;    int y = 2;cout << x << ", " << y << endl;    variableTest(x, y);cout << x << ", " << y << endl;    return 0;}int variableTest(int ^ x, int ^ y){    x += y;    y -= x;cout << x << ", " << y << endl;}[\code]fast and safe.The best of both worlds fast and safe is pass by constant reference. If you are still with me you can probably guess what this means. We get the speed and efficiency of pass by reference, but the function can not modify the variables. This is especially useful for operating system / API calls where you are getting data from the user or application program. You as the system level software or operating system have no right to modify the data you've been given. plus if they have given you a struct of of employee data that has several variables like name, id, and address, you would much rather be shuffling around pointers and not big bulky employee structs./code]#include using namespace std;void variableTest(const int x, const int y);int main(){    int x = 1;    int y = 2;cout << x << ", " << y << endl;    variableTest(x, y);cout << x << ", " << y << endl;    return 0;}int variableTest(const int x, const int y){    x += y;    y -= x;cout << x << ", " << y << endl;}[\code]

URL: https://forum.audiogames.net/post/413464/#p413464




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: Question about bgt handles

CAE_Jones wrote:Are handles supported for strings in BGT? It's kinda weird about handles for things like vectors.Not sure here, I just used it to clarify things, didn't test it though and creating copies of strings doesn't take too long usually, don't use it anywhere as far as I remember.CAE_Jones wrote:BGT doesn't let @ work on ints, floats, etc, which I believe is how it works in Java, too? But if you declare a function or method that takes "int " instead of just "int", that's effectively the same as sending a reference rather than a copy. ... But you don't do anything different when modifying the variable, because that would make sense -_-Thats not all that needs to be said here. AngelScript knows three different ways of handling function parameters:: only used for input references. Modifying the variable given with that parameter will either raise a compilation error or simply do nothing (don't know right now). I guess using that one isn't very useful, at least I never did that (it probably doesn't matter if you pass the handle or the variable here, since we're talking about primitive data types like int and float).: only used to return a value to the outer world, the variable passed into the function won't be initialized and you can't read from it. (or simply &) does both and thus is a full call by reference call, you can read and also write to this variable.CAE_Jones wrote:You're probably wondering why it's "@a = b", and not "@a = @b", and I have no idea.Its again AngelScript (BGT) that takes your hand here. @a = @b works as well, but AngelScript knows that @a can only be set to another handle and thus creates the handle of b automatically to assign it to @a.Best Regards.Hijacker

URL: https://forum.audiogames.net/post/413439/#p413439




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Question about bgt handles

Are handles supported for strings in BGT? It's kinda weird about handles for things like vectors.@1: Handles make more sense if you have experience with C / C++ / C#. Except they do some confusing things at times, even then, compared to their low-level counterparts. Handles are kinda like pointers, which are references to the memory address where the variable in question is stored. At the lowest level, you're dealing with how things are handled in the CPU and RAM, except CPUs, afaik, don't have a way to deal with object-oriented programming on a hardware level, and what's being passed around are values in CPU registers. Unless they're wrapped in a high-level construct, arrays are basically a pointer to the first entry, and saying x[y] is equivalent to a pointer to x+(y×sizeof()).Naturally, that can get messy real quick with complex programs, and Java simplifies it by making everything function as a handle/pointer/reference. This means you need methods for cloning objects (ex: System.arraycopy), which normally isn't that big a deal. For some reason, Angelscript (in which BGT is built) goes with something in between but closer to C#.So anything done in BGT without an @ is trying to act on the data directly. To make matters more confusing, if you call a function like myfunc(x), it works regardless of whether the function takes a handle or its referent.Generally speaking, if you want it to work the way it does in Java, you'll be using lots of @s. And that's usually what you want.BGT doesn't let @ work on ints, floats, etc, which I believe is how it works in Java, too? But if you declare a function or method that takes "int " instead of just "int", that's effectively the same as sending a reference rather than a copy. ... But you don't do anything different when modifying the variable, because that would make sense -_-Generally, you want to use handles in these situations:Comparing class instances. If (@a == @b), if (@x == @this). This is the same as Java if (a == b) and if (x == this).When a function or method needs to permanently modify the objects passed to it. If you wanted to write an implementation of quicksort in BGT, for instance, your parameters would be declared as int[]@, rather than just int[]. Same holds if it's a different type of array.Assigning. "@a = b" makes it so that a and b reference the same instance. "a = b" attempts to clone b to a, which will usually break on an already-initialized object without an opAssign method. You're probably wondering why it's "@a = b", and not "@a = @b", and I have no idea.Dictionaries. BGT is sufficiently weird about this that I try to always have functions to simplify it. If you want to add a sound to a dictionary, you'd do something like "dict.add(key, @handle)", and to get something from a dictionary, you need to have a handle to assign it to: "dict.get(key, @handle)".Factory functions should generally return handles. "sound@ get_sound(string filename)", for instance.Object arrays, especially as members of another class. This shows up a lot in games (ex, a class for a map, level, etc, with an array of items or enemies). "enemy@[] enemies". This gets confusing, because you can say "enemy@[]", "enemy[]@", "enemy@[]@", or "enemy[]", and they all mean slightly different things. If the @ is after the brackets, it's a handle to the array. If it's before the brackets, it's an array of handles. I generally use arrays of handles more than handles to arrays, and handles to arrays of handles is probably useful but hasn't come up much.Remember that null is already treated like a handle, so you should never say "@null", but should always say "@a = null" when nullifying a reference. I think "a=null" would cause a null pointer error.As a general rule, when in doubt, use handles. Also, order of operations can be a jerk and require you use parentheses to avoid ambiguity regarding to what the @ refers, but I haven't worked out the exact order and just use parentheses for anything with a dot or brackets, just to be safe.

URL: https://forum.audiogames.net/post/413415/#p413415




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Question about bgt handles

2019-02-21 Thread AudioGames . net Forum — Developers room : Hijacker via Audiogames-reflector


  


Re: Question about bgt handles

Hi,you can do so too, but this will internally create copies of the data you move around. When coming from the Java world, you most probably won't get in touch with the call by reference and call by value patterns.Call by value means that whenever you assign a value to a different variable or call a function with a given parameter which isn't a handle, this data will be copied. Take this one for example:string teststring="this is a test";

void testfunc(string text)
{
  // we will append some data here to demonstrate the difference
  text = text + " in bgt";
  alert("text", text);
  alert("teststring", teststring);
}

void main()
{
  testfunc(teststring);
}What you will notice is the following:* the first alert, which prints the text variable, will show "this is a test in bgt", because we appended the " in bgt" part.* the second alert however will still print "this is a test", because we called by value here, means, the content of teststring got copied to a new variable which then got passed to testfunc(), means we can do whatever changes we like to text within testfunc and the original variable teststring won't know anything about it.Call by reference however passes only the handle to that variable into testfunc, which results in two things:* less time consuming function calls, since in-memory copies still are time-consuming operations* the variable can be modified from within the called function. Lets adopt the above example to make things clear.string teststring="this is a test";

void testfunc(string@ text)
{
  // we will append some data here to demonstrate the difference
  text = text + " in bgt";
  alert("text", text);
  alert("teststring", teststring);
}

void main()
{
  // note that you don't need to use the @ sign in the two lines below, bgt will do this for you already
  testfunc(@teststring);
  testfunc(@teststring);
}What you will notice here is the following:* the first call to testfunc() will end up alerting two things, and two times the same thing: this is a test in bgt. Thats because the editing of text ended up editing teststring as well, because we passed in a reference here, not a value.* the second call to testfunc will also print the same thing: this is a test in bgt in bgt, because we again appended stuff to the text variable which is just another name for teststring.Conclusion:call by reference can be performed in a given time, no matter the data you are actually handling, since the operation of receiving a handle to a given variable is performed in constant time, whereas copying large arrays to calling a function by value or copying the array between variables can get pretty time consuming. when copying arrays with objects in them you can also run into the problem of shallow copies, meaning that the array itself is actually a copy, but the objects aren't. This can lead to trouble when you're believing that you can freely edit your objects without editing the objects stored separately, but in fact edit both of them at once. Understanding how handles work can therefore improve your programming skills and also bring some significant performance boosts to the programs you're developing, and since handles (or pointers) aren't just important when developing in bgt, but also in C/C++ and other languages, its recommended to get used to them, even if newer high-level languages usually don't require to know about them, since they will do all the stuff for you in the background.Hope that helped.Best REgards.HijackerPS: I didn't test the code snippets above and thus don't guarantee them to be working.

URL: https://forum.audiogames.net/post/413364/#p413364




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Question about bgt handles

2019-02-20 Thread AudioGames . net Forum — Developers room : ricardo0922 via Audiogames-reflector


  


Question about bgt handles

Hi,I'm stuck on the idea of handles with BGT. At the moment, I develop mainly in Java, and I'm used to passing objects directly to functions. For instance, I can do this with an array:Person person = new Person();Person[] personArray = new Person[1];personArray[0] = person;In BGT, that would look something like this:Person person;Person[]@ personArray = Person[1];@personArray[0] = @person;I'm not sure if my BGT was 100 percent right but the idea is there. How do the @ signs work, when do you use them, and are handles basically references? Why can you not pass the object like this:Person[] personArray = Person[1];personArray[0] = person;Thank you.

URL: https://forum.audiogames.net/post/413324/#p413324




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Probably really obvious question about bgt?

2016-10-31 Thread AudioGames . net Forum — Developers room : severestormsteve1 via Audiogames-reflector


  


Re: Probably really obvious question about bgt?

If it's fields where you input and it's Sudoku, you can have each grid entry in the array or dictionary, and when you curser over it, have an x and a y curser. x is controlled with left and right, y controls up and down. If you're on any of these, pressing enter on it will clear it, and you can then type a number in there and press enter to save it. Then it makes sure this number is not the same as another square in the grid.

URL: http://forum.audiogames.net/viewtopic.php?pid=284816#p284816





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Probably really obvious question about bgt?

2016-10-31 Thread AudioGames . net Forum — Developers room : BlindProgrammer1998 via Audiogames-reflector


  


Re: Probably really obvious question about bgt?

Another obvious question. I am attempting to create a sudoku game. Is there a way to create a grid with text field in BGT? Looking through the docs, I can't find anything. Thanks for any help.

URL: http://forum.audiogames.net/viewtopic.php?pid=284809#p284809





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Probably really obvious question about bgt?

2016-10-27 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector


  


Re: Probably really obvious question about bgt?

BGT needs sets The find method will work in  numeric arrays. Just see if the index of the found value is less than the index you're checking, and that it is greater or equal to 0.

URL: http://forum.audiogames.net/viewtopic.php?pid=284257#p284257





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Probably really obvious question about bgt?

2016-10-27 Thread AudioGames . net Forum — Developers room : lukas via Audiogames-reflector


  


Re: Probably really obvious question about bgt?

Hi,this question certainly is not as obvious as many others that other people have been asking, don't worry. :-)The find method of the array object could probably help you. If you use it like a given value not found in the array means that it doesn't equal any other, it might work, or at least it seems so off the top of my head.Hope this helps,Lukas

URL: http://forum.audiogames.net/viewtopic.php?pid=284241#p284241





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Probably really obvious question about bgt?

2016-10-26 Thread AudioGames . net Forum — Developers room : BlindProgrammer1998 via Audiogames-reflector


  


Probably really obvious question about bgt?

Hi all,I'm new to BGT, and rather new to programming in general. I'm writing an audio game where I need to check the values in an array against a newly added value to make sure none are equal. Based on this, I would then need to change the new value to make sure it does not equal another value in the array. Does anyone know a function that would accomplish this? Thanks for any help!

URL: http://forum.audiogames.net/viewtopic.php?pid=284223#p284223





___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-19 Thread AudioGames . net Forum — General Game Discussion : jaybird via Audiogames-reflector


Re: question about bgt download

I cant run that game. Is the download supposed to be incomplete or something? When I try to run it, I get the following:File: X:\adv\your_adventure core\your_adventure.bgtOn line: 423 (1)Information: Compiling void dragonhill_mountains()File: X:\adv\your_adventure core\your_adventure.bgtOn line: 435 (1)Line: area_1_dm();Error: No matching signatures to area_1_dm()URL: http://forum.audiogames.net/viewtopic.php?pid=177512#p177512

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-19 Thread AudioGames . net Forum — General Game Discussion : pelantas via Audiogames-reflector


Re: question about bgt download

whoopsie. havent prevended that from happening. will edit the code so it will work and will post a new link.applogies.greetz mikeURL: http://forum.audiogames.net/viewtopic.php?pid=177516#p177516

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-19 Thread AudioGames . net Forum — General Game Discussion : pelantas via Audiogames-reflector


Re: question about bgt download

hi again,i rushed through my system, downloaded all the required software i needed like bgt, filezilla etc. my pc was installed again last weekend. and i editted the stuff. and on my computer it works right now.you dont have to go to the website again, ill post a direct link. but beware. it is very simple. it isnt simular to the your_adventure game right now. in its alpha version. so you have be warned. expect wacky code. but good to start with.https://dl.dropboxusercontent.com/u/930 … 20core.ziphthgreetz mikeURL: http://forum.audiogames.net/viewtopic.php?pid=177517#p177517
___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-18 Thread AudioGames . net Forum — General Game Discussion : pelantas via Audiogames-reflector


Re: question about bgt download

and when you want to see simple code in action you can download the your_adventure core, from before the alpha version 1 i released with visionproductions, from:http://www.mikeschipper.nljust go to the downloads section and download the your_adventure core. extract the file, and press the right click on the your_adventure.bgt file and select edit script.this way you can view my first game code wich i provided to the community.easier than this i cant explain it.hthgreetz mikeURL: http://forum.audiogames.net/viewtopic.php?pid=177324#p177324

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

question about bgt download

2014-06-15 Thread AudioGames . net Forum — General Game Discussion : kamochek via Audiogames-reflector


question about bgt download

hi.why when i going to blastbay website, it says that the site is updating with inportant information.so when can i download bgt?and please give me an example of coding.kamochek.URL: http://forum.audiogames.net/viewtopic.php?pid=176983#p176983

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-15 Thread AudioGames . net Forum — General Game Discussion : roro via Audiogames-reflector


Re: question about bgt download

You can download it from their software page. But what do you meen by giving you an example? I have some knowledge in it, but the manual contains many examples, so I can never explain it to you in one single post.Regards.URL: http://forum.audiogames.net/viewtopic.php?pid=176986#p176986

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-15 Thread AudioGames . net Forum — General Game Discussion : scotf2012 via Audiogames-reflector


Re: question about bgt download

I do not see a problem. You should be able to download from here. As for coding examples, first you should read the BGT manual, as it has many examples suitable for beginners.URL: http://forum.audiogames.net/viewtopic.php?pid=177013#p177013

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-15 Thread AudioGames . net Forum — General Game Discussion : frastlin via Audiogames-reflector


Re: question about bgt download

there are also example games, there are like 10 of them.URL: http://forum.audiogames.net/viewtopic.php?pid=177023#p177023

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: question about bgt download

2014-06-15 Thread AudioGames . net Forum — General Game Discussion : mohammad///obid via Audiogames-reflector


Re: question about bgt download

And I really advice ya to read the Language Tutorial first.URL: http://forum.audiogames.net/viewtopic.php?pid=177036#p177036

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-13 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Sorry for a lot of questions, but please help me with file encryption and decryption.Ive serialized a map data, encrypted it and saved it as a file. After that, I cant decrypt it correctly.I tried to write a simple test program to find the reason, but still no luck. Can anyone explain why this is, and how to solv it?void main(){int mode=1;//0:creates a test file, 1: tries to load and decrypt itfile f;string a;switch(mode){case 0:f.open(a.txt,w);a=abcabcabcabcabc;f.write(string_encrypt(a,abc));f.close();break;case 1:f.open(a.txt,r);alert(result,string_decrypt(f.read(),abc));break;}alert(done,done);}This script fails to decrypt the string Ive written in the file.URL: http://forum.audiogames.net/viewtopic.php?pid=176805#p176805

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-13 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Sorry for a lot of questions, but please help me with file encryption and decryption.Ive serialized a map data, encrypted it and saved it as a file. After that, I cant decrypt it correctly.I tried to write a simple test program to find out the reason, but still no luck. Can anyone explain why this is, and how to solve it?void main(){int mode=1;//0:creates a test file, 1: tries to load and decrypt itfile f;string a;switch(mode){case 0:f.open(a.txt,w);a=abcabcabcabcabc;f.write(string_encrypt(a,abc));f.close();break;case 1:f.open(a.txt,r);alert(result,string_decrypt(f.read(),abc));break;}alert(done,done);}This script fails to decrypt the string Ive written in the file.URL: http://forum.audiogames.net/viewtopic.php?pid=176805#p176805

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-13 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Sorry for a lot of questions, but please help me with file encryption and decryption.Ive serialized a map data, encrypted it and saved it as a file. After that, I cant decrypt it correctly.I tried to write a simple test program to find out the reason, but still no luck. Can anyone explain why this is, and how to solve it?void main(){int mode=0;//0:creates a test file, 1: tries to load and decrypt itfile f;string a;switch(mode){case 0:f.open(a.txt,w);a=abcabcabcabcabc;f.write(string_encrypt(a,abc));f.close();break;case 1:f.open(a.txt,r);alert(result,string_decrypt(f.read(),abc));break;}alert(done,done);}This script fails to decrypt the string Ive written in the file.URL: http://forum.audiogames.net/viewtopic.php?pid=176805#p176805

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-13 Thread AudioGames . net Forum — General Game Discussion : lukas via Audiogames-reflector


Re: Question about BGT

Philip once told me that binary mode should always be used for reading and writing files. When I asked him for the reason why text mode was there in the first place then, and why it should not be used, he told me that he couldnt remember any more but that it had something to do with the way that the standard system APIs access files in the system. From a very brief look at your code, I cant see anything obviously wrong with the script itself, so I hope this tip might help you out.LukasURL: http://forum.audiogames.net/viewtopic.php?pid=176846#p176846

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-13 Thread AudioGames . net Forum — General Game Discussion : CAE_Jones via Audiogames-reflector


Re: Question about BGT

Binary mode would work better for encrypted files, since theyre not encrypted as ascii characters.Text mode works if you only want to work with text (example: the Swamp Map Editor, since Swamp Map Files are ascii text files)Part of me panics at those case blocks not being inside braces, but if it works without them, then yay!URL: http://forum.audiogames.net/viewtopic.php?pid=176874#p176874

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-13 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

I googled about that. It seems that it automatically converts newline codes to display the text properly on other operating systems.URL: http://forum.audiogames.net/viewtopic.php?pid=176878#p176878

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-09 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Hi.Ive encountered an additional question. For declaring multi dimensional arrays, are there any simpler ways than resizing all the valiables?URL: http://forum.audiogames.net/viewtopic.php?pid=176436#p176436

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-09 Thread AudioGames . net Forum — General Game Discussion : CAE_Jones via Audiogames-reflector


Re: Question about BGT

I dont think there are, unfortunately.You could write a function likeint[][] array2d(int size1, int size2) {
 int[][] ret(size1);
 for(uint i=0; isize1; i++) {
  ret[i].resize(size2);
 }
 return ret;
}But I think youd need a new function for every type or number of dimensions.URL: http://forum.audiogames.net/viewtopic.php?pid=176465#p176465

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Question about BGT

2014-06-05 Thread AudioGames . net Forum — Off-topic room : yukionozawa via Audiogames-reflector


Question about BGT

Hi.As the title says, I have a question about coding in BGT.Is there any ways to substitute different types of class handles in one array? I think I cant.I would like to handle many different types of objects in the game. For example, the game has robots, dragons, and demons as enemies, and pits, mines as obstacles, and other objects like items, switches. In this case, the only way I know is declaring multiple classes for each type of the object, and check them for each loop like this.for loop//enemies actions//obstacles actions//other objects actionsfor loop endThough I can use switch structure for coding different moves or strategies for each type of the enemy, thats very complicated I think.I thought it would be helpful if I could declare a array called objects, and place all class handles in it.If it can be written, I can do like this.for loopif(objects(i).condition==active) objects
 (i).act();for loop end(note:some characters were changed because they were blocked as errors by this forum)By doing this, each object runs its particular act function like robot.act, dragon.act, or elevater.act. Is it actually possible? And if not, how do you control multiple types of objects with simple and high-performance way? Just switch?URL: http://forum.audiogames.net/viewtopic.php?pid=176088#p176088

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — Off-topic room : keyIsFull via Audiogames-reflector


Re: Question about BGT

Yes, BGT supports interfaces, which are basically just lists of common signatures among classes. Read section 11.3 in the bgt manual; it has the scoop on interfaces, and then if you still have questions, let me know.URL: http://forum.audiogames.net/viewtopic.php?pid=176092#p176092

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — Off-topic room : CAE_Jones via Audiogames-reflector


Re: Question about BGT

It is possible to declare an array of objects that match a given interface, so you can do exactly what you said.Example:interface enemy {
void act();
// Add more if needed.
}

class Robot : enemy{
// Robot properties.

// Robot constructor:
Robot() {}
void act()
{
// Code for robots.
 robot_method();
}

void robot_method() {
// You cannot access this method if the Robot is known only as an enemy,
// but the act method knows its a Robot, so just call act.
}

}

class Dragon : enemy {
// Dragon properties.

// Constructor:
Dragon() {}

void act()
{
// Code for Dragons.
}
}


enemy@[] enemies;

void load_level(uint level) {

enemies.resize(0); // Not important for the example, but a good idea.
if (level==10)
{
Robot r;
enemies.insert_last(r);
Dragon d;
enemies.insert_last(d);
}
}
void game_loop() {

for(uint i=0; ienemies.length(); i++) {
enemies[i].act();
}
}You probably wont need to cast an enemy to a specific class after youve created it. If you do need to cast, though, you can do this:Robot@ r=castRobot(enemies[i]);
if(@r!=null) {
// Do something with the Robot.
 r.robot_method();
}
else {
// It is not a robot. Try something else?
 Dragon@ d=castDragon(enemies[i]);
if(@d!=null)
{
// Do something with a Dragon.
}
else {
// Default?
}
}But it should be possible to avoid the need to cast. It is better if more operations of objects begin in interface methods; that way, casting is unnecessary.I hope this wasnt confusing...URL: http://forum.audiogames.net/viewtopic.php?pid=176098#p176098

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — Off-topic room : yukionozawa via Audiogames-reflector


Re: Question about BGT

Oh, I now understood most of the codes. Thank you.URL: http://forum.audiogames.net/viewtopic.php?pid=176103#p176103

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Thank you for your answer. Ive read the section.Reading the interface section, I thought I can use common signatures for different classes, but how do I handle those classes with only one array? I dont understand the difference between just declaring a class and the subclass, and this interface structure.URL: http://forum.audiogames.net/viewtopic.php?pid=176095#p176095

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Oh, I now understood most of the codes. Thank you.URL: http://forum.audiogames.net/viewtopic.php?pid=176103#p176103

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Question about BGT

2014-06-05 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Question about BGT

Hi.As the title says, I have a question about coding in BGT.Is there any ways to substitute different types of class handles in one array? I think I cant.I would like to handle many different types of objects in the game. For example, the game has robots, dragons, and demons as enemies, and pits, mines as obstacles, and other objects like items, switches. In this case, the only way I know is declaring multiple classes for each type of the object, and check them for each loop like this.for loop//enemies actions//obstacles actions//other objects actionsfor loop endThough I can use switch structure for coding different moves or strategies for each type of the enemy, thats very complicated I think.I thought it would be helpful if I could declare a array called objects, and place all class handles in it.If it can be written, I can do like this.for loopif(objects(i).condition==active) objects
 (i).act();for loop end(note:some characters were changed because they were blocked as errors by this forum)By doing this, each object runs its particular act function like robot.act, dragon.act, or elevater.act. Is it actually possible? And if not, how do you control multiple types of objects with simple and high-performance way? Just switch?URL: http://forum.audiogames.net/viewtopic.php?pid=176088#p176088

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — General Game Discussion : CAE_Jones via Audiogames-reflector


Re: Question about BGT

It is possible to declare an array of objects that match a given interface, so you can do exactly what you said.Example:interface enemy {
void act();
// Add more if needed.
}

class Robot : enemy{
// Robot properties.

// Robot constructor:
Robot() {}
void act()
{
// Code for robots.
 robot_method();
}

void robot_method() {
// You cannot access this method if the Robot is known only as an enemy,
// but the act method knows its a Robot, so just call act.
}

}

class Dragon : enemy {
// Dragon properties.

// Constructor:
Dragon() {}

void act()
{
// Code for Dragons.
}
}


enemy@[] enemies;

void load_level(uint level) {

enemies.resize(0); // Not important for the example, but a good idea.
if (level==10)
{
Robot r;
enemies.insert_last(r);
Dragon d;
enemies.insert_last(d);
}
}
void game_loop() {

for(uint i=0; ienemies.length(); i++) {
enemies[i].act();
}
}You probably wont need to cast an enemy to a specific class after youve created it. If you do need to cast, though, you can do this:Robot@ r=castRobot(enemies[i]);
if(@r!=null) {
// Do something with the Robot.
 r.robot_method();
}
else {
// It is not a robot. Try something else?
 Dragon@ d=castDragon(enemies[i]);
if(@d!=null)
{
// Do something with a Dragon.
}
else {
// Default?
}
}But it should be possible to avoid the need to cast. It is better if more operations of objects begin in interface methods; that way, casting is unnecessary.I hope this wasnt confusing...URL: http://forum.audiogames.net/viewtopic.php?pid=176098#p176098

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — General Game Discussion : Dark via Audiogames-reflector


Re: Question about BGT

Moderation! sinse Bgt is a game creation engine, this topic belongs in general game discussion. The offtopic room is for stuf not! about games, and while I know there are lots of topics about programming, game programming is still game related, so Im moving the topic.URL: http://forum.audiogames.net/viewtopic.php?pid=176104#p176104

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector

Re: Question about BGT

2014-06-05 Thread AudioGames . net Forum — General Game Discussion : yukionozawa via Audiogames-reflector


Re: Question about BGT

Oh, I thought that programming discussion belongs to off-topic. Thank you for moving the topic.URL: http://forum.audiogames.net/viewtopic.php?pid=176146#p176146

___
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector