Author Topic: My First Map- Trouble already!  (Read 5241 times)

0 Members and 1 Guest are viewing this topic.

Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #15 on: June 27, 2011, 05:20:41 PM »
Good luck with the map, it looks like a good one so far. I would say, though, that you might want to not call your asteroids things like a1, as that's sometimes used for lines and stuff. It shouldn't be a major problem, but...

Using Annikk's DrawLine() example above, the 'official' definition of it is DrawLine(x1, y1, x2, y2, r1, g1, b1, a1, r2, g2, b2, a2, thickness). Consider the following code:

Code: [Select]
line = DrawLine(0,0,100,100,0,0,0,0.99,255,255,255,0.99)
line.a1 = 0.5

Unless I'm totally wrong (which I often am, sometimes very stupidly and badly) that would change the value of line 's    a1 value. Not much of a problem, but it could cause confusion in longer codes.

Sorry for being so pedantic, and I probably have hundreds of bad practices myself, but I just thought that mentioning little things like that would make it easier in the long run. Give's a hoi if I'm being too harsh.

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #16 on: June 28, 2011, 06:23:26 AM »
You guys are the best! I really appreciate all of your help and encouragement. I don't know how to do the fancy formatting in response to each comment, so I'll just cover them all here like this.

Pilchard, I agree my asteroid naming might not be too good in the long run, but for my learning purposes of how the grid system works, at this point, it helps me keep things organized in my head. I think there is probably a fine line between having too short a name and too long in having to type it out repeatedly later. I'll have to come up with some kind of nomenclature that works for me as I figure things out. Regarding that Drawline function, I was playing with it and I could swear the "g" and the "b" are reversed. I know it makes more sense the other way but maybe I'm just generally confused.

Annikk, I don't know what you do for a living but you should be a teacher. You make things so clear and obviously have a lot of patience and enjoy passing along your knowledge. With each answer, though, you generate 10 more questions. I'm trying to answer them all myself through experimentation and it's very time-consuming. Thanks for helping me warp-speed ahead in my understanding so far. When you said "type a full stop" into the console, what does that mean? I also have experienced quite a few error messages so far. Is the number I see in the error message the line number in the code? I'm using notepad and of course there are no line numbers. Is there any alternative program that automatically shows line numbers off to the side or something?

A few questions for anyone-
Is the player automatically assigned to Empire 1, "Greys" to Empire 0, and any other opponents 2 and above?

Another question which is difficult to ask because I'm not sure how to word it- but I'm trying to figure out how the game processes the functions- specifically how they are ordered. I assume the processing starts at line 1, and then progresses sequentially through the code. But obviously there are things at the bottom of the code that the program knows, while it is working on things in the function level logic section. I get the impression that the entire code is read and any functions are processed, and then anything in the function logic section is run during the game. If a process requires some information from another part of the code, it will refer to it but the main routine is contained in the function level logic. The other functions act kind've like subroutines. Does that make any sense? If anyone understands what I'm trying to say and would care to try to educate me I'd appreciate it. Maybe as I get more code written  I can attach an example and explain myself better.

Attached is an update on my progress if you're interested. You can start to get an idea of where I'm headed...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #17 on: June 28, 2011, 09:55:25 AM »
Hey dude :>

Glad to hear things are going well!
Experimentation is the beginning of awesome things.. :>


Quote
Thanks for helping me warp-speed ahead in my understanding so far

No worries :>


Quote
When you said "type a full stop" into the console, what does that mean

I meant the "period" symbol (.) but really anything will do.  Go ahead and type in "fishcakes" if you prefer.  :>  The object of the exercise is to enter any old junk into the console, in case of a "stuck" error message.



Quote
Is the number I see in the error message the line number in the code?

Yes :D


Quote
I'm using notepad and of course there are no line numbers. Is there any alternative program that automatically shows line numbers off to the side or something?

There is!  May I be the first to recommend the brilliant Notepad++.
As well as line numbers, it also colour-codes the code to highlight specific lua commands making it far easier to spot typos, and it's fully skinnable, has unlimited undo levels... and it's totally free.  :>
I personally use the "Deep Black" skin.  So much easier on the eyes than white notepad!



Quote
Is the player automatically assigned to Empire 1, "Greys" to Empire 0, and any other opponents 2 and above?

Yep that's correct.  :>
Also, GetEmpire(2) is the same thing as GetAI(2).  I tend to use Empire for everything, because you can also refer to Empire 1 (the player) and Empire 0 (the greys).


Quote
Another question which is difficult to ask because I'm not sure how to word it- but I'm trying to figure out how the game processes the functions- specifically how they are ordered. I assume the processing starts at line 1, and then progresses sequentially through the code. But obviously there are things at the bottom of the code that the program knows, while it is working on things in the function level logic section. I get the impression that the entire code is read and any functions are processed, and then anything in the function logic section is run during the game. If a process requires some information from another part of the code, it will refer to it but the main routine is contained in the function level logic. The other functions act kind've like subroutines. Does that make any sense?

You're correct that things run in a specific order.  Here's when each function is run:

LevelSetup()
This code is run when the level is loaded.

LevelLogic()
Once the level has loaded and is running, this code is what runs next.

LevelDraw()
This code runs continuously at a rate of 60 frames per second.  It runs "in between" Level Logic cycles.

ScreenDraw()
As above.

OnAsteroidTaken()
This code is run whenever an asteroid changes owner.

OnAsteroidRevealed()
This code is run whenever an asteroid is revealed to an empire.


Apart from that, what you say is correct - it starts at line 1 and works its way down.



I'll go check out your work in progress now.  I'll post back shortly.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #18 on: June 28, 2011, 10:11:57 AM »
This looks awesome by the way.. :>
Really nice design.  I love the cross thing in the middle, very cool.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #19 on: June 28, 2011, 10:19:46 AM »
The map is currently throwing up an error though, that's because of this line:

Code: [Select]
x[0] = math.cos(input) * scale
y[0] = math.sin(input) * scale

The reason why it produces an error is that you haven't specified what "scale" is!  You need a line, either at the very top of LevelLogic(), or anywhere in LevelSetup(), sometime like:

Code: [Select]
scale = 1
or..

Code: [Select]
scale = 0.5
or whatever you want to set it to.  :>

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #20 on: June 28, 2011, 10:21:03 AM »
Spotted one more query I can reply to:


Quote
Regarding that Drawline function, I was playing with it and I could swear the "g" and the "b" are reversed. I know it makes more sense the other way but maybe I'm just generally confused.

You're correct, they're reversed!  I had forgotten about that, but you're absolutely right.  I believe it's a bug.  :>

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #21 on: June 28, 2011, 11:07:49 AM »
AAAck! You know what? Before I posted that map I stripped it of most of the detritus of my experimentation to clean it up, and the Scale declaration got stripped out. It's there in my original map. I'm surprised it still worked.

I'll see if I can download that Notepad program right away. It will probably be a huge help!

Thanks for explaining the code execution. It's gradually making sense now. Some of the myriad ideas I have may actually come to fruition! It's getting very tricky now because I'm trying to do some scripting and I don't have my mind wrapped around the structure of the programming yet. I printed out your Intermediate Coding Guide and its getting a lot of use!

Well, back to the coding grindstone...

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #22 on: June 28, 2011, 11:13:19 AM »
It certainly sounds like you are getting a handle on this pretty quickly.  :>
Looking forward to seeing what you come up with!

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #23 on: June 28, 2011, 12:25:31 PM »
Got the Notepad++. That's EXACTLY what I was picturing. I've already solved a problem thanks to it.

I've got quite a few really cool ideas in my head and am looking forward to making them work. Nothing like 3D Rotating Cubes or Gravity Engines, but maybe some useful things like your RoidForge or at least some twists on the game formats I've seen so far. I've got so much to learn I just worry I'll reach a plateau I can't overcome. One really good thing going for me is all the good people here on this site who are all so supportive of each other. That can make all the difference in the world. Like you pointed out somewhere, we all stand on the shoulders of giants and I certainly am going to take advantage of that!

Actually, since I'm here I have a question. In your list of operations, am I correct in thinking that LevelSetup() MUST be run first, but that the other sections can be put in any order? I was looking at a program where Screendraw came before LevelLogic(). I'm wondering because I put function ScreenDraw() above LevelDraw(), and now suddenly my LevelDraw() is not implementing. I haven't fooled around with it yet to find what is happening, but overall, is my thinking correct?

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #24 on: June 28, 2011, 01:08:42 PM »
Hmm, I'm not sure if it matters what order the functions appear in... but by convention, I usually do LevelSetup() first, and all the other functions in whatever order pleases me.  Always worked fine so far!  :>

Glad you like Notepad++ :>  I wouldn't worry about reaching a limit where you just can't go any further, that's unlikely to happen.  :>

Making something crazy like gravity or a 3D engine is generally only as hard as understanding the concept behind it.  Once you can visualise what needs to be calculated, you can usually just go and google for the maths that is needed.

The two most-used maths rules I've found so far are Pythagoras and the Intersection of Two Lines.  Both those are generally covered in school, though most people soon forget them... but it turns out they are really really useful for coding :>  Anyway, the point is that the maths behind those two is not rocket science, and you can teach it to yourself in an afternoon if you wanted to.  :>

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #25 on: July 10, 2011, 09:35:19 AM »
A few questions for anyone:

No matter what I do, the "GetNumFactions()" Function Returns a value of "12". Anyone else have that problem or know of a cause or work-around?

What about GetNumInactiveFactions? How can a faction be "inactive"?

Is there any way for a player to be able to choose the number of factions, either directly or indirectly?

What specifically does the VignetteAlpha control? I can't see any difference when I enter different values (0 -255).

Is it normal for local variables to be held in memory after quitting a map to the menu screen and then immediately loading it againr?

Does anyone else ever experience double-menus, where an extra menu panel will appear mid-screen that can't be removed? It will usually disappear when restarting the game.

I've searched, but haven't been able to find a list of default game/global settings/variables. Is that information available in one place? The threads I've seen mostly do not give value ranges nor default values.

Thanks for any responses...


Pilchard123

  • Tester
  • Old Oak
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 17
  • Posts: 899
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #26 on: July 10, 2011, 10:01:02 AM »
Does anyone else ever experience double-menus, where an extra menu panel will appear mid-screen that can't be removed? It will usually disappear when restarting the game.

Yup, but I have never worked out how to prevent them. They just go after some stimulus that I don't know. That said, it may be a piece of your code. If you're making custom maps, comment out bits of code in a binary search pattern. That should narrow it down.

http://en.wikipedia.org/wiki/Binary_search_algorithm

Aino

  • Ent
  • ******
  • Thank You
  • -Given: 1
  • -Receive: 20
  • Posts: 1,483
  • They'll eat you next!
  • Eufloria: Yes
Re: My First Map- Trouble already!
« Reply #27 on: July 10, 2011, 10:14:54 AM »
Let me begin:

    - GeNumFactions() return 12, because the game has the limit of 12, this is very useful for when you would like to have all the factions active at once.
    - A faction is automatically set to inactive when it has 0 asteroids and 0 seedlings, so you can actually use the GetNumInactiveFactions() function to create a win condition!
    - Yes, you can create alot of stuff that just creates new factions. For example: if you create a button with ScreenDraw() and then make a button out of it(make it react to clicks) and when clicked, the game create a new faction on a barren asteroid owned by the greys. changing the owner and adding atleat a dysontree of 10 seedlings. This way, you can change the amount of empires. I don't know if you can decrease it a secure way though.
    - VignetteAlpha I got no real idea of what does, ask Annikk, as it seems he knows more of it than I do :P
    - This is pretty normal, but local variables? But to prevent this, set the variable to a default value before even using it, this way, you don't need to be afraid of stuff changing.
    - Double-menus are nromal when messing around with ScreenDraw(), the most common way for it to appear, atleast for me, is that I change the window size in-game.
    - Have you tried the
Lua scripting reference? This leads directly to the post about globals, it tells you what the globals are(integer or floats), and you don't need to care about the limits very much, since if you go over the max, it will change it to the max(in-game, not directly on the code!)

Hope that was everything :)
[/list]

Lost Seedling

  • Shrub
  • ***
  • Thank You
  • -Given: 3
  • -Receive: 3
  • Posts: 148
Re: My First Map- Trouble already!
« Reply #28 on: July 11, 2011, 05:04:55 AM »
Well I've given up on the GetNumFactions route and the player-choice route- after a great deal of experimentation I decided to just go the randomized way. For whatever reason I just couldn't get any game behavior to be altered with mouse clicks and buttons. I could make graphics changes but I only got crashes or no results at all linking to anything else. Maybe I'll incorporate that into a future map as my skills increase. Aino, I studied your CC map code and Annik's Roid Forge code but it's just too much work for my little map.

I've created a thick binder of all the information I could find here on the global variables, etc. If the default values are indeed the max values then that makes things somewhat easier. I've already gone through one ink cartridge!

I'm beginning to wrap up my map layout and features and am beginning to tweak the Global variables and other things in an effort to create a balanced game-play. I'm very interested in hearing other's opinions and philosophies on what they think makes a good map and a challenging, yet fun, experience in the game. Since as a map-maker you are able to decide how easy or difficult the game-play will be, how do you judge if a map is too hard or too easy? Some maps are so easy and repetitive one play-through is enough. Others are so difficult and epic that you have to devote a couple of hours to it's completion. Granted, part of the attraction of this game is it's grand, epic campaign and stately progression of marshalling forces across the asteroid field, but can a map be too large and long for it's own good? As a player, do you like surprises, and sudden changes of fortune late in the game, or do prefer a more systematic approach?

How many seedlings should I give the player? Should I give them just enough to struggle to survive, attractive to a more-experienced player, or should I be more generous and make it easier to expand and conquer- more suitable for beginners? What's "difficult" for me may be easy for most- I don't know.

Of course I realize that there is no "correct" answer to these questions, but I'm interested in hearing other map-maker's thoughts on what they think is a reasonable level of difficulty to aim for. Maybe I should ask this in a new thread? 

annikk.exe

  • Achiever
  • Ent
  • ****
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1,794
Re: My First Map- Trouble already!
« Reply #29 on: July 11, 2011, 06:35:30 AM »
What specifically does the VignetteAlpha control? I can't see any difference when I enter different values (0 -255).

The vignette is is a darkening around the edges of the screen.
The "alpha" of the vignette is how dark the vignette is.

In Extreme Pwn Laz0rz, the vignette starts at maximum, and then descends to 0, in the opening moments of the game.  I did that as a little intro thingy.  :>  It means the focus starts out on the laser mine, and the edges are darkened... then gradually the surroundings becomes visible.


Quote
Is it normal for local variables to be held in memory after quitting a map to the menu screen and then immediately loading it againr?

Yes.  If you initialise your variables in LevelSetup() then it shouldn't cause you problems, though.  For this reason, be wary of using any conditional that checks if a value is nil!


Quote
Does anyone else ever experience double-menus, where an extra menu panel will appear mid-screen that can't be removed? It will usually disappear when restarting the game.

Yes I get that from time to time, usually when maximising the game window.  A restart usually clears it, and then I maximise the window while in the menus, and it's fine...


Quote
I've searched, but haven't been able to find a list of default game/global settings/variables. Is that information available in one place? The threads I've seen mostly do not give value ranges nor default values.

If you look in your Eufloria\Resources folder, you'll find a file called default.xml.  This contains a list of all the default values for global variables.



Quote
I'm very interested in hearing other's opinions and philosophies on what they think makes a good map and a challenging, yet fun, experience in the game. Since as a map-maker you are able to decide how easy or difficult the game-play will be, how do you judge if a map is too hard or too easy? Some maps are so easy and repetitive one play-through is enough. Others are so difficult and epic that you have to devote a couple of hours to it's completion. Granted, part of the attraction of this game is it's grand, epic campaign and stately progression of marshalling forces across the asteroid field, but can a map be too large and long for it's own good? As a player, do you like surprises, and sudden changes of fortune late in the game, or do prefer a more systematic approach?

How many seedlings should I give the player? Should I give them just enough to struggle to survive, attractive to a more-experienced player, or should I be more generous and make it easier to expand and conquer- more suitable for beginners? What's "difficult" for me may be easy for most- I don't know.

Of course I realize that there is no "correct" answer to these questions, but I'm interested in hearing other map-maker's thoughts on what they think is a reasonable level of difficulty to aim for.

This is a good question and one we as level designers don't really spend enough time discussing.  What makes a map fun?
Here are my own thoughts on this:

1.  I think the level should be slightly unpredictable.  Grid-like levels are very predictable and unsatisfying to play on, for example.

2.  The level should be beatable within 1-5 attempts by most players.  Totally impossible maps are frustrating, ridiculously easy maps are unsatisfying.  Remember that you coded your map and you play it over and over during testing, so you know it very well - others will not have this advantage, so bear this in mind when setting the difficulty.  When you release a map, it's worth saying in your post how difficult the level is.  Casual levels are ok too - not all of us are 1337 gamers!

3.  You need to pay some attention to the pace of the level.  If you give the player 200 seedlings at the start, they will need to rush around grabbing lots of asteroids right at the beginning, leading to a stressful, fast-paced early game.  If you give them 10 seedlings, it will take ages for the game to get going.  Whereas if you gave them 45 seedlings, that's enough to colonise 1-2 asteroids and scout a couple more, which is a fairly nice pace imho.

4.  If the level has some crazy mechanics in it, the controls for it should be _completely_ intuitive.  If people can't work out how to play your level within a minute or two or without an instruction manual, it's not fun.

5.  Originality is good.  It's far from the only thing that makes a level good, but it's cool to see something totally new - the novelty is interesting to people.  However there is also a distinct lack of "normal" style maps these days, and I suspect a demand exists for those sorts of levels that don't try to bend the game into something totally crazy.

6.  Polish is important.  Check the spelling in your message boxes, make a nice banner image for your level when you release it, make sure you've not left lots of the asteroids exactly the same size/send distance..  ensure everything is nicely adjusted and balanced.

7.  Testing is crucial - if you release a level and then it turns out there's a bug in it that totally breaks things, this is not fun at all.  Get other people to test your level too, and listen to their feedback.

8.  The player must be able to win with different approaches.  They must have choices.  Linear levels are not fun.  Levels where you can only win with a single tactic are generally not so fun.
« Last Edit: July 11, 2011, 06:40:13 AM by annikk.exe »