MAP Problems.
Author |
Message |
TWizard
|
Posted: Fri Aug 12, 2011 12:15 am Post subject: MAP Problems. |
|
|
Bio: I'm building a new game, well rebuild actually, i'v built my own civilization games before but they didn't go as far as i wanted them to go, this time around i'm setting up a lot more variables. My goal for this game is for it to be close to real time play, with real time battle's, also, to have this game span over a whole galaxy, were you would start on a planet and advance through technology, I'v already set up how most of this would work on paper before hand, so planing is mostly done, but there are a few things that i do not remember how to do because i'm just returning back to Turing, so i'v lost most of my previous work and methods of writing, and there are some things in which i have no idea where to begin. Some of my complications are.
Require help:
- To be able to zoom in, and, out of the map, and, also to be able to scroll around the map. I have a few ways of doing this but i think it would conflict with some of my previous procedures, some of my solutions were to re-size things as you got closer or farther, or to have set graph and move to a new sector, but the only reason i'm looking to zoom in and out is for the battles, as of right now if i had set the game up the army's would look so small and hard to manage being far away, i'v also thought to move to a new screen to manage the battles, but i think that would take away from the real time game play, because there would be many battles going on at the same time, so moving to a new screen would not be a good choice.
- My second idea was to make this game LAN playable and was curious if there was 'any' way of doing this, as i would not like to only have people face other computers, i would like the users to verse other users as they are less predictable.
- Another problem i think would come into play would be that Turing would not be able to handle all my ideas i would like to put in, i have thought of loading from other Turing programs to load 1 main program, as just to split to program up, or condense the code, though even then it still may not be able to handle all the variables, one problem i see, is that the program would be slowed, unite movement would not be the same, calculations would be slowed, ect. If there are suggestions on how i would fix that or if it cant be fixed then play let me know.
I would like this game to go far, even with in its own limits, i do not want to move on to C# or another program language as of yet. I do not expect this to be a quick fix but, i am hoping to get good feed back, ideas and also how to fix these problems. I am experienced in this language as it makes it easy to learn, but i'd like to take advantage of all that Turing has to offer.
If you have any questions you would like to ask me, or something you would like me to answer about what i'v previously said, please post it, and, i will try to get back to you as soon as i possibly can. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
mirhagk
|
Posted: Mon Aug 15, 2011 8:22 am Post subject: RE:MAP Problems. |
|
|
I can help out a little with Turing (I could help out much more with C#). Alright let's start:
1st idea is simple to manage, just hold 4 variables to store your position and your magnification. Then use these variables to draw the screen.
2nd idea def possible, although somewhat confusing. And you can't go beyond LAN.
3rd this actually isn't that much of a problem. Yes turing is slow, but variables are cheap, and turing's variables cost no more than any other languages, you could potentially have billions of integers in your program, so you don't have to worry about that. It's the calculations that might be a problem, you may have a bad frame rate if you don't code things right. Simply just be careful, don't caluclate things you don't need to every frame etc. |
|
|
|
|
|
Raknarg
|
Posted: Mon Aug 15, 2011 8:55 am Post subject: RE:MAP Problems. |
|
|
I think the only real issue for speed is how detailed he wants his pictures. If you dont have very detailed pictures, its much faster.
If you dont want to do that though, I reccomend drawing the pictures yourself rather than using imported pictures, as pictures are much slower. |
|
|
|
|
|
mirhagk
|
Posted: Mon Aug 15, 2011 9:53 am Post subject: RE:MAP Problems. |
|
|
If he plans on making a full fledged game, updating all the battles and everything going on will actually take a long time in Turing. Oh and it is possible to static-ly load a picture in the Turing program. You can define it as an array of colours, and set each colour specifically before the program even loads. Alternatively you can load the pictures and store them into your own color arrays if you believe Turing handles pictures too slowly (although I suspect it does it just fine). |
|
|
|
|
|
Prince Pwn
|
Posted: Mon Aug 15, 2011 11:23 am Post subject: Re: RE:MAP Problems. |
|
|
mirhagk @ Mon Aug 15, 2011 8:22 am wrote:
2nd idea def possible, although somewhat confusing. And you can't go beyond LAN.
Why can't you go beyond LAN? I'm doing it right now with a project, hosting the turing server at home |
|
|
|
|
|
mirhagk
|
Posted: Mon Aug 15, 2011 11:56 am Post subject: RE:MAP Problems. |
|
|
Sorry lol, guess you can. Turing is just incapable of telling you what your external IP is. I guess you could go beyond LAN, it just isn't something that they intended I guess.
I personally have never gone beyond LAN with turing, but that's also because I hate dealing with port forwarding and all that jazz.
However going beyond LAN would mean you either need to host a global server for every computer to connect to, or every host would need to set up port forwarding. |
|
|
|
|
|
TWizard
|
Posted: Mon Aug 15, 2011 1:27 pm Post subject: RE:MAP Problems. |
|
|
Using 4 variables to hold the screens position? I'v only ever though of it to draw the screen from 0,0 to PosX, PosY. I don't think i fully understand on using variables to either hold the screens 'location' or to move the entire screen.
I don't think i want this game to go beyond LAN, but how would i go about setting up the variables for LAN? i would not know where to begin, i can only think to have the program search for another Turing signature.
I'm trying to make this game, fun and easy to play for all groups but also when people want to as complex as anyone could think, as of right now i'm building all the computer controls, and started with some user interface, maybe later down the road i would need help setting up the types of battle and how would each race interact with each other, although i think i can manage that, but just setting the variables would be a bit difficult. that could be a sub goal if anyone has an idea on it. If you need more information just ask, i'm more then glad to share
I an familiar with C# though i cant quite grasp all that it can do, i'm just overwhelmed writing the variables or using whats provided, though i know someone who will be able to help me with that, when i would like to advance this game a bit farther.
Thank you for all the post, and i'm happy to learn that Turing is able to have LAN connection and even go beyond. |
|
|
|
|
|
Insectoid
|
Posted: Mon Aug 15, 2011 3:59 pm Post subject: RE:MAP Problems. |
|
|
As for drawing, you should be using your own modified draw procedures that translate the image before drawing it, instead of the 'dumb' draw procedures Turing ships with.
code: |
var zoom : int %this is global, so that you don't need to pass it as a parameter ever
proc draw_something (something_to_draw, coordinates)
Pic.Resize(image, some_formula)
apply_offset %adjust the coordinates. Things tend to move away from the centre when you zoom. See the Turing Walkthrough's 3D tutorial; it should be the same equation
Pic.Draw (modified_image, modified_coordinates)
end draw_something |
You can optimize this, by limiting magnification to say, 3 zoom levels (as opposed to scrolling to zoom to whatever is comfortable) and pre-calculating new image sizes and offsets for each at startup, so there's less calculation to do in-game (I bet Pic.Resize() is horribly slow). |
|
|
|
|
|
Sponsor Sponsor
|
|
|
TWizard
|
Posted: Tue Aug 16, 2011 4:02 am Post subject: RE:MAP Problems. |
|
|
Hmm, thank you i shall try and see if i can get that working maybe more information would be a bit useful at a later time, but for now i'm going start work on the menu, and how every thing will be set up, then ill move on from there.
If anyone has an idea on how to set up LAN connection, that would be much appreciated. |
|
|
|
|
|
mirhagk
|
Posted: Tue Aug 16, 2011 7:15 am Post subject: RE:MAP Problems. |
|
|
Look up Turing's net commands. They are quite easy. One machine waits for a connection and then the other one connects to it.
The problem is that you cannot "search" for a connection. Well you can but Turing takes a little while before returning a failure on a connection, so searching through each possible local ip would take a while.
As for the drawing, if you wanted any level of zoom, then you could just draw the picture yourself. Think of it this way, if you have a square that's normally 10x1 and your zoomed in by 5.4, then the square's new size is 54x54. You can start 26 away from the center and basically just divide each position by 5.4 to get what pixel of the picture it is. |
|
|
|
|
|
TWizard
|
Posted: Wed Aug 24, 2011 11:44 pm Post subject: RE:MAP Problems. |
|
|
Eh this idea of moving the map is becoming a nightmare, i'v found another way to zoom in and out, and also to scroll, although it itself is kinda hard thinking, but i'll bring it up another time. I would like to think of a new idea, is it possible to move the location of the run screen? And have everything else stationary? because i'd like to have movable unites and stationary buildings on the map. I would hate to think to redraw them every time i move the screen.
This game i'm currently trying to build is to have both the aspects of a strategic and tactical game play, in both battle and creating an empire.
If you need more information please post asking. |
|
|
|
|
|
TWizard
|
Posted: Fri Aug 26, 2011 7:33 pm Post subject: RE:MAP Problems. |
|
|
Hmm, i think i have found a fix to these problems, i'm going to be look more at the game play now, i will try to put this down in program so i wont have to do it later, although any suggestions on this matter would be most welcome.
I'm also looking for more ideas to put into this game, so they also would be helpful, if you are in need of more information about the creation of this game please just post and i will answer the best i can.
The goal for this game is to be able to play real time civilization based game, although the graphics may not be the best, but the game play to be something to think about when you decide to attack another race or civilization, the effects on your empire and how will you take the lead in victory through conquest technology or universal peace? also to not only be playing against computers but also friends, possibly later down the road to have this game over the web. This may or may not seem like a big goal for not a vary big programming language, but i'd like to see this game go far even with the Turing limits.
Thanks for all the previous help, i appreciate it and help to return the favor. |
|
|
|
|
|
mirhagk
|
Posted: Sat Aug 27, 2011 6:25 pm Post subject: RE:MAP Problems. |
|
|
BTW on the map/screen issue, what you need to do is keep the map and units and everything at the same location. Then you hold variables for where the screen is looking.
From there all you need to do is add the screen offset to every item you draw and presto you have a moving screen. Simply change the screen offset and you'll change where your looking. |
|
|
|
|
|
|
|