View topic - map metal layer


All times are UTC + 1 hour


Post new topic Reply to topic  [ 18 posts ] 
Author Message
 Post subject: map metal layer
PostPosted: 31 May 2012, 02:11 

Joined: 31 May 2012, 01:50
Folowing the tutorial I see the engine is used "redscale" to place the metal supplies but is any option to edit/add (prefer lua) new layers?

I'm interested in add some more resources to map... for example how to add new layer for gold supplies... wher it's hold script that "make metal metal" if U catch what I mean...

Is it posible to define layer (where/how) with other color and conect it via scripting adding at result new type of supply to the map and make it usable for new building to use and gather materials?
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 02:28 
User avatar

Joined: 02 May 2005, 02:56
Location: Canada
metal is hard coded in the engine... so the good news is you can handle gold however you want... but the bad news is you'd have to implement it all yourself in Lua... you might be able to adapt code from an existing project though.


Last edited by SinbadEV on 31 May 2012, 02:40, edited 2 times in total.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 02:36 

Joined: 31 May 2012, 01:50
and where the code is?
Is it write in c++? Try to avoid c++ and use only lua, I think if it's predefined in engine it can't be add without integrating in source code of engine or it's can be separetly done as lua script?

Some doc link or other related stuff examples etc will be a greate help... I'm a beginer with few expirenced with UDK, CHROME ENGINE and NeoAxis ... unfortunetly c/c++/c# is not my favorite way to do things work ;)
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 02:45 
User avatar

Joined: 02 May 2005, 02:56
Location: Canada
This is an implementation of metal map overriding... but it only does metal, you could do something like this except you'd need to create a way for units to harvest too...

viewtopic.php?f=13&t=28077&hilit=metal+spot

but you could also go crazy and do something like making the gold-mines into gaia controlled units and have peons get their "gold" variables increased while they are near it and then have a player building that would look for nearby peon units with a non-0 gold variable and add it to a player gold variable... like I said, the good news is you can do pretty much whatever you need to to suit your needs... you just need to do it yourself...


Pika wrote:
and where the code is?
Is it write in c++? Try to avoid c++ and use only lua, I think if it's predefined in engine it can't be add without integrating in source code of engine or it's can be separetly done as lua script?

It would all be in Lua, no source hacking needed.

Pika wrote:
Some doc link or other related stuff examples etc will be a greate help... I'm a beginer with few expirenced with UDK, CHROME ENGINE and NeoAxis ... unfortunetly c/c++/c# is not my favorite way to do things work ;)


I am not experienced enough with programming Lua for spring myself to advise but if you explain what it is you are trying to do in more detail and post some images of what you've got so far you might attract some positive attention from those who are.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 04:15 
User avatar

Joined: 02 May 2005, 02:56
Location: Canada
Because I am bored I thought I would try to further confuse you so that you get a feel for the scope of what your wanting to do:

It sounds like you want to make a game but you are asking about maps... this tells me that you are making a game and maps.

each unit in the game has it's own Lua-object-model which you would need to code in such a way as to handle the new resource... much of this could be included from a general new default unit.


You would need to have some kind of Lua code in the game (we often call these "gadgets" for synced code and "widgets" for unsynced code but it's all "game" code) to negotiation communication between these unit scripts, the graphical user interface you expect players to use to interact with the new resource coded of your units and the map or gaia units you are getting to handle resources.

In your map you would need code to communicated with the game code, units and user interface... though ideally this would just be a list of gold locations for the game to read etc.

That said... other people have created open source scripts that do a lot of this type of things for their own games... so once you figure out how to read Lua and game assets and understand how it all fit's together you'll be able to find a lot of what you need is already done.

Here are some starting points:

Like I said, you've described a game that uses custom maps so the first thing to figure out is how to make a game:
http://springrts.com/wiki/Game_and_Unit ... evelopment

you should probably try to work through one of the tutorials like

http://springrts.com/wiki/The_Complete_ ... pring_Game will take you from 0 to having a model in game... (I wrote much of "Simple Game Tutorial" back before people had even started thinking about things like Lua and were still using 3do models so it is exceptionally out-dated...)

Once you get a basic handle on that you can dive into Spring Lua Scripting, Spring's Lua Interface is basically a bunch of hooks that attach to the engine that will take a while to get your head wrapped around... but Lua shouldn't be too hard to get a basic start on:

http://springrts.com/wiki/Lua_Scripting

one idea would be to create a widget... widgets are unsynced code that can run in most games so you'd be able to get a feel for Spring Lua Scripting without having to wrap your head around making games and units and maps and hooking them all together.

http://springrts.com/wiki/Lua_Widgets
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 08:39 
Moderator
User avatar

Joined: 26 Oct 2007, 15:21
I recommend the
http://springrts.com/wiki/Lua_SyncedCtrl#MetalAmount

Callin.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 10:56 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
NO!

Metal is all luaable now!

viewtopic.php?f=13&t=28077

EvoRTS Glacier Pass has a lua metal map.

In the gui stuffs, you could change the word metal to gold quite easily.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 12:08 

Joined: 31 May 2012, 01:50
WOW!

I'm very happy with you help...

this lua script you link is only other way to locate the supplies on map...

My problem is where the "metal" is defined (can be bulid on it and get gather)

More simple... total anhilation style... i've got metal on map, can bulid mine on it and gather... and the task is to make new "class" for example gold that will work same way (bulid mine on it and gether) I just don't familiar with spring and got any idea how to and where to look

1) script that make metal from redscale (and expand it to use 2 other colors and places [via difrent supply-maps]next 2 types of supply)
2) script that make mine gather the supply (as metal extractor)

I'm a beginer and for start try to edit/copy/add scripts based on org code of spring games/samples

maybe I'm stupid and I can do it by editing this linked script but i think the "metal" is predefined and can't find where and the lua script gets only cord where the metal is display on map and the last var 1.7 is if I guess corectly the capibilyty of metal source (how many metal can I gather until supply is "end") Corect me if I wrong...
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 12:25 
User avatar

Joined: 02 May 2005, 02:56
Location: Canada
Beherith wrote:


Forboding Angel wrote:
NO!

Metal is all luaable now!

viewtopic.php?f=13&t=28077

EvoRTS Glacier Pass has a lua metal map.

In the gui stuffs, you could change the word metal to gold quite easily.

I am certain that he wants gold in addition to metal... and, unless I'm very much mistaken, while Metal placement is "Luaable now!" the core mechanic of metal extractors being placed on the ground and harvesting metal is still very much entrenched in the engine... clearly it can all be overridden but he is asking how to add an additional layer of a different resource that can be used in the same way as the metal layer on the feature map and that is not something that can be done yet so I was trying to make this clear without causing the fellow to lose hope.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 12:42 
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
metal extractors in engine:
https://github.com/spring/spring/blob/d ... ilding.cpp
is not that interessting though.

There is only one metal layer in the engine.
But there are also "geo spots" and you can have buildings that can only be build on those spots. (guess TA had this too)
You could have lots of geo spots on the map (remove the smoke) and use it as your 2nd metal layer.
That would be the simplest.
---
But if you feel like it, you can do more:
Basically it comes down to having variables, being able to draw on the map and having controll over unit construction. spring has all that with Lua.
e
it is possible to
-make 2D array to store where "gold" is to be found
-draw that on the map to create something like F4 but red and with "gold"
-have per-team variables that store their "gold" resourcs
-stop construction of units when "gold" is low

It would be similiar to this:
http://www.youtube.com/watch?v=7A0tTHNpDgs
just instead of making the units invisible when they are in the blue bubbles, make them "produce gold".
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 12:59 

Joined: 31 May 2012, 01:50
YES final result is to have gold, stone and iron... all gather same way as metal... I'm afraid it is not as easy as i think after spending few hours unpacking and read scripts no one add new resorces type to game...

Changing GUI name for metal would not solve the problem, but fact it's take about few minutes ;)


Last edited by Pika on 31 May 2012, 13:11, edited 1 time in total.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 13:11 
User avatar

Joined: 02 May 2005, 02:56
Location: Canada
Pika wrote:
YES final result is to have gold, stone and iron... all gather same way as metal... I'm afraid it is not as easy as i think after spending few hours unpacking and read scripts no one add new resorces type to game...

Changing GUI name for metal would not solve the problem, but fact it's take about few minuts ;)


"Easy Option"
Replace Energy with Wood (you already get energy from trees)
Replace Metal with Stone (you already get it from the ground)
Build the custom player variable for gold, as knorke suggested, and have geothermal plants increment the value of this variable each game cycle and produce no energy.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 13:28 

Joined: 31 May 2012, 01:50
Quote:
Build the custom player variable for gold as knorke and have geothermal plants increment the value of this variable each game cycle and produce no energy.


Build the custom player variable for gold
No idea how to do it [make engine recognize it as new supply, I will be very gratefull for any examples] If somebody help with some lua scripting example of creation it...

Have geothermal plants increment the value of this variable...
Is it can by bulid only in specifited area or any places on map?
Where is script that hold it's funcionality?

At end when is new var for gold made, I only need the plant to add value to it not to the wood/energy that I think I can handle ;)

this tutorial with box, next tank setup is geting my computer freez and halt the spring... any other samples (other games/examples) run well I've use win 7 x64 ultimate with 6GB of ram intel q6600 cpu and Nvidia SLI 2x gainward bliss 512mb GDDR III 256bit each one... on 9600GT Nvidia GPU based on ASUS striker MB... after loading is count 3...2...1... then freez :(

Bios and all drivers are up to date, i try with difrent map and AI
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 31 May 2012, 20:06 
Evolution RTS Developer
User avatar

Joined: 17 Nov 2005, 02:43
Post your infolog.txt
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 01 Jun 2012, 12:07 

Joined: 31 May 2012, 01:50
Now I get it to work, simply use My documents patch to copy new files NOT in game folder in program files ;)
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 04 Jun 2012, 06:53 
Moderator

Joined: 12 Oct 2007, 08:24
SinbadEV wrote:
I am certain that he wants gold in addition to metal... and, unless I'm very much mistaken, while Metal placement is "Luaable now!" the core mechanic of metal extractors being placed on the ground and harvesting metal is still very much entrenched in the engine... clearly it can all be overridden but he is asking how to add an additional layer of a different resource that can be used in the same way as the metal layer on the feature map and that is not something that can be done yet so I was trying to make this clear without causing the fellow to lose hope.
You are mistaken. My metal placement system only uses the engine metal map for backwards compatibility. With my system there are no units that technically extract metal, it is all done by adding resources to player stockpiles.

Pika I assume you are planning to make a game with more than 2 resources and are also planning to make the maps for this game. In this case you should ignore the metalmap completely. Arbitrary resource type and placement can be defined by adding lua files to your maps.

My system (or evo's easymetal) would be easy to modify to allow for many different types of resources which are each gathered by placing a structure on a point. The game Conflict Terra also has a working implementation of mobile harvester drop off point gathering.

The engine itself only has 2 build in resources but it should be fairly easy to write gadgets that extend this number. I know GundamRTS has (or had?) 3 resources but never looked into how that was done. The 'normal' RTS pay up front system of resource management is trivial to implement and I think I could implement constant construction for many resource types fairly easily too.
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 07 Jun 2012, 10:15 

Joined: 31 May 2012, 01:50
tell me pleas, how the game know where is the spot for mine? How can I set it to point without using metalmap? Do you places it's via Lua with x: and y: coords or what?

Thanks for reply
Top
 Offline Profile  
 
 Post subject: Re: map metal layer
PostPosted: 07 Jun 2012, 12:33 
Moderator

Joined: 12 Oct 2007, 08:24
Which game? No Spring game that I know of uses multiple types of mines.

I may as well say "hey, how do I define the spot on the map that spawns aliens?".

It is relatively easy to do this stuff in Spring with lua scripts but there is no concept within the engine. This kind of thing can be included in maps.

But I am probably getting ahead of myself tell us entirely what you are trying to do. There are a lot more things to do before you think about implementing multiple mine types.
Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Site layout created by Roflcopter et al.