improvements to the minimap

OpenSpades is an open source alternative client for AoS Classic and beyond! Runs on Windows, Mac, and Linux. Created by yvt.
Compatible with AoS Classic.
8 posts Page 1 of 1
pandaro
Deuced Up
Posts: 26
Joined: Wed Jun 04, 2014 8:06 am


First of all, hello to everyone, and a warm thank you for this native client for linux, without which no powers to play occasionally in aceofspades.

Secondly, I want to apologize because this post is double,you can find an approximate summary of my intentions here:
https://github.com/yvt/openspades/issues/303

Third, I want to propose some changes that refer to a single code file .cpp In: /Source/Client/MapView.cpp
and some specific icons./resource/Dev/Paks27.zip ->pak000-Base.pak ->/Gfx/Map/Player.png

Now I will try to convince you that I'm not saying something stupid.

THE CURRENT STATUS OF MINIMAP
At this time the minimap simply represents the same icon for each player, this icon is located within /resource/DevPaks27.zip within pak000-Base.pak inside /Gfx/Map and is called Player.png. It is a simple white isosceles triangle, above which a filter is applied in the same color of the team player.

MY IDEA
the goal is to have a more representative and useful minimap
First of all a unique colour for each players is useless. So it would be appropriate to apply a filter based on the identifier of the connection, and more simply, one color for each player.
In the /Source/Client/MapView.cpp file There is a function can return the id of connection as represented in the Score board:
for(int i = 0; i < world->GetNumPlayerSlots(); i++){
Player * p = world->GetPlayer(i);
if(!p) continue;
}

renderer->SetColorAlphaPremultiplied(AFILTERCOLOUR);

Secondly:
Instead of a unique triangular shape for each player perhaps (but this is a proposal least) three icons
of different shapes depending on the weapon supplied to the player.


Why do all this?

Why openspades is a nice client but can improve.
For better organization ingame.

Often I move without organization: as no one has any idea what the other players do. With these two small steps, each player would have a precise idea of where another player. It could also have an idea of what combat technique adopted, in agreement with the weapon the other player has.

I thank you all for your attention and I hope to receive a positive response.

EDIT!
ADD DOWNLOAD FOR BETA TESTER
instead of this address you can download and try openspades, modified by me:
https://www.dropbox.com/s/w180ug0lw2hcc ... ar.gz?dl=0

I remind you that all your compliments are to do in ivthttps://github.com/yvt/openspadesWithout which openspades not exist and I could not have done anything

installation is the same openspades,
Once the installation is finished, inside the folder openspades-0.0.12/Gfx/Map you find 3 icons.
put it in ~/.local/Share/openspades/Resources/Gfx/Map
If the folder does not exist:create it
Last edited by pandaro on Wed Jan 21, 2015 7:11 pm, edited 1 time in total.
pandaro
Deuced Up
Posts: 26
Joined: Wed Jun 04, 2014 8:06 am


Now I will tell you that I'm trying to do everything alone Green_tongue
But I will never succeed if you do not help me (I only know a little 'python and a bit' of Lua.ALL by myself
study).
I have two fundamental problems:
1)
renderer->SetColorAlphaPremultiplied(COLOURFILTER);
I do not know the syntax of color filter,not know what to write in brackets to filter the icon of the player with a color.
2)
I added an icon inside DevPaks27.zip
-> pak000-Base.pak / Gfx / Map /
an icon .png created with gimp.
But it is not recognized, even if the rename: "player.png", there seems to be some compatibility problems.

Thanks a lot
pandaro
Deuced Up
Posts: 26
Joined: Wed Jun 04, 2014 8:06 am


this is the error when I try to change the icon of the player in the minimap.
Code: Select all
2015/01/20 13:16:29 [MainScreen.cpp:246] [!] Error while running a game client: File not found: Gfx/Map/a2.png
at /home/p/openspades-0.0.12/Sources/Core/FileManager.cpp:39
static spades::IStream* spades::FileManager::OpenForReading(const char*) at FileManager.cpp:32
spades::draw::GLImage* spades::draw::GLImageManager::CreateImage(const string&) at GLImageManager.cpp:73
spades::draw::GLImage* spades::draw::GLImageManager::RegisterImage(const string&) at GLImageManager.cpp:51
virtual spades::client::IImage* spades::draw::GLRenderer::RegisterImage(const char*) at GLRenderer.cpp:254
void spades::client::Client::DrawJoinedAlivePlayerHUD() at Client_Draw.cpp:377
void spades::client::Client::Draw2DWithWorld() at Client_Draw.cpp:730
void spades::client::Client::Draw2D() at Client_Draw.cpp:880
virtual void spades::client::Client::RunFrame(float) at Client.cpp:382
virtual void spades::gui::MainScreen::RunFrame(float) at MainScreen.cpp:234
void spades::gui::SDLRunner::Run(int, int) at SDLRunner.cpp:414
void spades::gui::Runner::Run() at Runner.cpp:75
void spades::gui::Runner::RunProtected() at Runner.cpp:48
int main(int, char**) at Main.cpp:369
LeCom
Post Demon
Post Demon
Posts: 866
Joined: Sat May 24, 2014 8:07 am


AoS is a game for authistic 10 yo kiddies who show off their MLG skills. They don't need teamwork or organization or whatever.
But, let's help you. Firstly, can you provide some values that OpenSpades uses instead of COLOURFILTER in different spots in the code, or in case COLOURFILTER an enum or macro, list the possible values? Secondly, did you even read the first line of your log? :P
pandaro
Deuced Up
Posts: 26
Joined: Wed Jun 04, 2014 8:06 am


Today I am very happy with what I could do.
Place the file here /source/Client/MapView.cpp
Whoever wants, can copy it and put it in the right place, then reinstall openspades and try the first result I got, that is:

a color for each player
Blue_Surprised2
Spoiler:
Code: Select all
/*
 Copyright (c) 2013 yvt
 
 This file is part of OpenSpades.
 
 OpenSpades is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 OpenSpades is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with OpenSpades.  If not, see <http://www.gnu.org/licenses/>.
 
 */

#include "MapView.h"
#include "IRenderer.h"
#include "IImage.h"
#include "Player.h"
#include "World.h"
#include "CTFGameMode.h"
#include "Client.h"
#include "GameMap.h"
#include "TCGameMode.h"
#include "../Core/Settings.h"

SPADES_SETTING(cg_minimapSize, "128");

namespace spades {
	namespace client {
		MapView::MapView(Client *c, bool largeMap):
		client(c), renderer(c->GetRenderer()), largeMap(largeMap){
			scaleMode = 2;
			actualScale = 1.f;
			lastScale = 1.f;
			zoomed = false;
			zoomState = 0.f;
		}
		
		MapView::~MapView(){
			
		}
		
		void MapView::Update(float dt){
			float scale;
			switch(scaleMode){
				case 0: // 400%
					scale = 1.f / 4.f;
					break;
				case 1: // 200%
					scale = 1.f / 2.f;
					break;
				case 2: // 100%
					scale = 1.f;
					break;
				case 3: // 50%
					scale = 2.f;
					break;
				default:
					SPAssert(false);
			}
			if(actualScale != scale){
				float spd = fabsf(scale - lastScale) * 6.f;
				spd = std::max(spd, 0.2f);
				spd *= dt;
				if(scale > actualScale){
					actualScale += spd;
					if(actualScale > scale)
						actualScale = scale;
				}else{
					actualScale -= spd;
					if(actualScale < scale)
						actualScale = scale;
				}
			}
			
			if(zoomed){
				zoomState += dt * 5.f;
				if(zoomState > 1.f) zoomState = 1.f;
			}else{
				zoomState -= dt * 5.f;
				if(zoomState < 0.f) zoomState = 0.f;
			}
		}
		
		void MapView::DrawIcon(spades::Vector3 pos,
							   spades::client::IImage *img,
							   float rotation){
			if(pos.x < inRect.GetMinX() ||
			   pos.x > inRect.GetMaxX() ||
			   pos.y < inRect.GetMinY() ||
			   pos.y > inRect.GetMaxY())
				return;
			
			Vector2 scrPos;
			scrPos.x = (pos.x - inRect.GetMinX()) / inRect.GetWidth();
			scrPos.x = (scrPos.x * outRect.GetWidth()) + outRect.GetMinX();
			scrPos.y = (pos.y - inRect.GetMinY()) / inRect.GetHeight();
			scrPos.y = (scrPos.y * outRect.GetHeight()) + outRect.GetMinY();
			
			scrPos.x = floorf(scrPos.x);
			scrPos.y = floorf(scrPos.y);
			
			float c = rotation != 0.f ? cosf(rotation) : 1.f;
			float s = rotation != 0.f ? sinf(rotation) : 0.f;
			static const float coords[][2] = {{-1, -1}, {1, -1}, {-1, 1}};
			Vector2 u = MakeVector2(img->GetWidth() * .5f, 0.f);
			Vector2 v = MakeVector2(0.f, img->GetHeight() * .5f);
			
			Vector2 vt[3];
			for(int i = 0; i < 3; i++){
				Vector2 ss = u * coords[i][0] + v * coords[i][1];
				vt[i].x = scrPos.x + ss.x * c - ss.y * s;
				vt[i].y = scrPos.y + ss.x * s + ss.y * c;
			}
			
			renderer->DrawImage(img, vt[0], vt[1], vt[2],
								AABB2(0, 0, img->GetWidth(), img->GetHeight()));
		}
		
		void MapView::SwitchScale() {
			scaleMode = (scaleMode + 1) % 4;
			
			lastScale = actualScale;
		}
		
		bool MapView::ToggleZoom() {
			zoomed = !zoomed;
			return zoomed;
		}
		
		static Vector4 ModifyColor(IntVector3 v) {
			Vector4 fv;
			fv.x = static_cast<float>(v.x) / 255.f;
			fv.y = static_cast<float>(v.y) / 255.f;
			fv.z = static_cast<float>(v.z) / 255.f;
			float avg = (fv.x + fv.y + fv.z) * (1.f / 3.f);;
			fv.x = Mix(fv.x, avg, 0.5f);
			fv.y = Mix(fv.y, avg, 0.5f);
			fv.z = Mix(fv.z, avg, 0.5f);
			fv.w = 0.f; // suppress "operating on garbase value" static analyzer message
			fv = fv * 0.8f + 0.2f;
			fv.w = 1.f;
			return fv;
		}
		
		void MapView::Draw(){
			World *world = client->GetWorld();
			if(!world)
				return;
			
			Player *player = world->GetLocalPlayer();
			if(client->IsFollowing()){
				player = world->GetPlayer(client->followingPlayerId);
			}
			if(!player)
				return;
			
			if(largeMap)
				if(zoomState < .0001f)
					return;
			
			GameMap *map = world->GetMap();
			Vector2 mapSize = MakeVector2(map->Width(), map->Height());
			
			Vector3 pos = player->GetPosition();;
			if(player->GetTeamId() >= 2){
				pos = client->followPos;
			}
			Vector2 center = {pos.x, pos.y};
			float cfgMapSize = cg_minimapSize;
			if(cfgMapSize < 32) cfgMapSize = 32;
			if(cfgMapSize > 256) cfgMapSize = 256;
			Vector2 mapWndSize = {cfgMapSize, cfgMapSize};
			float scale = actualScale;
			
			center = Mix(center,
						 mapSize * .5f,
						 zoomState);
			
			Vector2 zoomedSize = {512, 512};
			if(renderer->ScreenWidth() < 512.f ||
			   renderer->ScreenHeight() < 512.f)
				zoomedSize = MakeVector2(256, 256);
			if(largeMap){
				float per = zoomState;
				per = 1.f - per;
				per *= per;
				per = 1.f - per;
				per = Mix(.7f, 1.f, per);
				zoomedSize = Mix(MakeVector2(0, 0),
								 zoomedSize,
								 per);
				mapWndSize = zoomedSize;
			}
			
			Vector2 inRange = mapWndSize * .5f * scale;
			AABB2 inRect(center - inRange, center + inRange);
			if(largeMap){
				inRect.min = MakeVector2(0, 0);
				inRect.max = mapSize;
			}else{
				if(inRect.GetMinX() < 0.f)
					inRect = inRect.Translated(-inRect.GetMinX(), 0.f);
				if(inRect.GetMinY() < 0.f)
					inRect = inRect.Translated(0, -inRect.GetMinY());
				if(inRect.GetMaxX() > mapSize.x)
					inRect = inRect.Translated(mapSize.x - inRect.GetMaxX(), 0.f);
				if(inRect.GetMaxY() > mapSize.y)
					inRect = inRect.Translated(0, mapSize.y - inRect.GetMaxY());
			}
			
			
			AABB2 outRect(renderer->ScreenWidth() - mapWndSize.x - 16.f, 16.f,
						  mapWndSize.x,
						  mapWndSize.y);
			if(largeMap){
				outRect.min = MakeVector2((renderer->ScreenWidth() - zoomedSize.x) * .5f,
										  (renderer->ScreenHeight() - zoomedSize.y) * .5f);
				outRect.max =MakeVector2((renderer->ScreenWidth() + zoomedSize.x) * .5f,
										 (renderer->ScreenHeight() + zoomedSize.y) * .5f);
			}
			
			float alpha = 1.f;
			if(largeMap){
				alpha = zoomState;
			}
			
			// fades bg
			if(largeMap) {
				Handle<IImage> bg = renderer->RegisterImage("Gfx/MapBg.png");
				Vector2 scrSize = {renderer->ScreenWidth(),
				renderer->ScreenHeight()};
				float size = std::max(scrSize.x, scrSize.y);
				renderer->SetColorAlphaPremultiplied(MakeVector4(0, 0, 0,alpha * .5f));
				renderer->DrawImage(bg,
									AABB2((scrSize.x - size) * .5f,
										  (scrSize.y - size) * .5f,
										  size, size));
			}
			
			// draw border
			Handle<IImage> border;
			float borderWidth;
			AABB2 borderRect = outRect;
			if(largeMap) {
				border = renderer->RegisterImage("Gfx/MapBorder.png");
				borderWidth = 3.f * outRect.GetHeight() / zoomedSize.y;
			}else{
				border = renderer->RegisterImage("Gfx/MinimapBorder.png");
				borderWidth = 2.f;
			}
			borderRect = borderRect.Inflate(borderWidth - 8.f);
			
			renderer->SetColorAlphaPremultiplied(MakeVector4(alpha,alpha,alpha,alpha));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMinX()-16,
									  borderRect.GetMinY()-16,
									  16, 16),
								AABB2(0, 0, 16, 16));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMaxX(),
									  borderRect.GetMinY()-16,
									  16, 16),
								AABB2(16, 0, 16, 16));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMinX()-16,
									  borderRect.GetMaxY(),
									  16, 16),
								AABB2(0, 16, 16, 16));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMaxX(),
									  borderRect.GetMaxY(),
									  16, 16),
								AABB2(16, 16, 16, 16));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMinX(),
									  borderRect.GetMinY()-16,
									  borderRect.GetWidth(), 16),
								AABB2(16, 0, 0, 16));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMinX(),
									  borderRect.GetMaxY(),
									  borderRect.GetWidth(), 16),
								AABB2(16, 16, 0, 16));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMinX()-16,
									  borderRect.GetMinY(),
									  16, borderRect.GetHeight()),
								AABB2(0, 16, 16, 0));
			renderer->DrawImage(border,
								AABB2(borderRect.GetMaxX(),
									  borderRect.GetMinY(),
									  16, borderRect.GetHeight()),
								AABB2(16, 16, 16, 0));
			
			// draw map
			renderer->SetColorAlphaPremultiplied(MakeVector4(alpha,alpha,alpha,alpha));
			renderer->DrawFlatGameMap(outRect, inRect);
			
			this->inRect = inRect;
			this->outRect = outRect;
			
			// draw grid
			
			renderer->SetColorAlphaPremultiplied(MakeVector4(0,0,0,0.8f*alpha));
			Handle<IImage> dashLine = renderer->RegisterImage("Gfx/DashLine.tga");
			for(float x = 64.f; x < map->Width(); x += 64.f){
				float wx = (x - inRect.GetMinX()) / inRect.GetWidth();
				if(wx < 0.f || wx >= 1.f)
					continue;
				wx = (wx * outRect.GetWidth()) + outRect.GetMinX();
				wx = roundf(wx);
				renderer->DrawImage(dashLine,
									MakeVector2(wx, outRect.GetMinY()),
									AABB2(0, 0, 1.f, outRect.GetHeight()));
			}
			for(float y = 64.f; y < map->Height(); y += 64.f){
				float wy = (y - inRect.GetMinY()) / inRect.GetHeight();
				if(wy < 0.f || wy >= 1.f)
					continue;
				wy = (wy * outRect.GetHeight()) + outRect.GetMinY();
				wy = roundf(wy);
				renderer->DrawImage(dashLine,
									MakeVector2(outRect.GetMinX(), wy),
									AABB2(0, 0, outRect.GetWidth(), 1.f));
			}
			
			// draw grid label
			renderer->SetColorAlphaPremultiplied(MakeVector4(1,1,1,1)*(0.8f*alpha));
			Handle<IImage> mapFont = renderer->RegisterImage("Gfx/Fonts/MapFont.tga");
			for(int i = 0; i < 8; i++){
				float startX = (float)i * 64.f;
				float endX = startX + 64.f;
				if(startX > inRect.GetMaxX() ||
				   endX < inRect.GetMinX())
					continue;
				float fade = std::min((std::min(endX, inRect.GetMaxX()) -
									   std::max(startX, inRect.GetMinX())) /
									  (endX - startX) * 2.f, 1.f);
				renderer->SetColorAlphaPremultiplied(MakeVector4(1,1,1,1)*(fade * .8f * alpha));
				
				float center = std::max(startX, inRect.GetMinX());
				center = .5f * (center + std::min(endX, inRect.GetMaxX()));
				
				float wx = (center - inRect.GetMinX()) / inRect.GetWidth();
				wx = (wx * outRect.GetWidth()) + outRect.GetMinX();
				wx = roundf(wx);
				
				float fntX = static_cast<float>((i & 3) * 8);
				float fntY = static_cast<float>((i >> 2) * 8);
				renderer->DrawImage(mapFont,
									MakeVector2(wx - 4.f, outRect.GetMinY() + 4),
									AABB2(fntX, fntY, 8, 8));
			}
			for(int i = 0; i < 8; i++){
				float startY = (float)i * 64.f;
				float endY = startY + 64.f;
				if(startY > inRect.GetMaxY() ||
				   endY < inRect.GetMinY())
					continue;
				float fade = std::min((std::min(endY, inRect.GetMaxY()) -
									   std::max(startY, inRect.GetMinY())) /
									  (endY - startY) * 2.f, 1.f);
				renderer->SetColorAlphaPremultiplied(MakeVector4(1,1,1,1)*(fade * .8f * alpha));
				
				float center = std::max(startY, inRect.GetMinY());
				center = .5f * (center + std::min(endY, inRect.GetMaxY()));
				
				float wy = (center - inRect.GetMinY()) / inRect.GetHeight();
				wy = (wy * outRect.GetHeight()) + outRect.GetMinY();
				wy = roundf(wy);
				
				int fntX = (i & 3) * 8;
				int fntY = (i >> 2) * 8 + 16;
				renderer->DrawImage(mapFont,
									MakeVector2(outRect.GetMinX() + 4, wy - 4.f),
									AABB2(fntX, fntY, 8, 8));
			}
			
			//draw objects
			Handle<IImage> playerIcon = renderer->RegisterImage("Gfx/Map/Player.png");
			IntVector3 white=IntVector3::Make(0, 0, 0);
			{
				IntVector3 change=IntVector3::Make(0, 0, 0);
				IntVector3 teamColor =
				world->GetLocalPlayer()->GetTeamId() >= 2 ?
				IntVector3::Make(000, 000, 000) :
				world->GetTeam(world->GetLocalPlayer()->GetTeamId()).color;
				Vector4 teamColorF = ModifyColor(teamColor);
				teamColorF *= alpha;
				
				// draw local player's view
				{
					Player *p = player;
					Handle<IImage> viewIcon = renderer->RegisterImage("Gfx/Map/View.png");
					if(p->IsAlive()) {
						Vector3 front = p->GetFront2D();
						float ang = atan2(front.x, -front.y);
						if(player->GetTeamId() >= 2){
							ang = client->followYaw - static_cast<float>(M_PI) * .5f;
						}
						
						renderer->SetColorAlphaPremultiplied(teamColorF * 0.9f);
						
						DrawIcon(player->GetTeamId() >= 2 ?
								 client->followPos :
								 p->GetPosition(), viewIcon, ang);
					}
				}
				
				// draw player's icon
				for(int i = 0; i < world->GetNumPlayerSlots(); i++){
					Player * p = world->GetPlayer(i);
					if(p == nullptr ||
					   p->GetTeamId() != world->GetLocalPlayer()->GetTeamId() ||
					   !p->IsAlive())
						continue;
					
					Vector3 front = p->GetFront2D();
					float ang = atan2(front.x, -front.y);
					if(player->GetTeamId() >= 2){
						ang = client->followYaw - static_cast<float>(M_PI) * .5f;
					}
				int palette[32][3]={
						{0,0,0},
						{250,250,250},
// 						{150,150,150},
// 						{50,50,50},
						
						{250,250,0},
						{0,250,250},
						{250,0,250},						
						{250,0,0},
						{0,250,0},
						{0,0,250},
						
						
						{250,250,150},
						{150,250,250},
						{250,150,250},						
						{250,150,150},
						{150,250,150},
						{150,150,250},
						
						
						{250,250,100},
						{100,250,250},
						{250,100,250},						
						{250,100,100},
						{100,250,100},
						{100,100,250},
						
						{250,250,50},
						{50,250,250},
						{250,50,250},						
						{250,50,50},
						{50,250,50},
						{50,50,250},
						
						{250,250,200},
						{200,250,250},
						{250,200,250},						
						{250,200,200},
						{200,250,200},
						{200,200,250},
						
						
				};
// 					
					IntVector3 change=IntVector3::Make(palette[i][0],palette[i][1],palette[i][2]);
					Vector4 changeF = ModifyColor(change);
					changeF *=1.0;
					renderer->SetColorAlphaPremultiplied(changeF);
					//printf( "MAP= %d\n", i);
					DrawIcon(player->GetTeamId() >= 2 ?
							 client->followPos :
							 p->GetPosition(), playerIcon, ang);
				}
			}
			
			IGameMode* mode = world->GetMode();
			if( mode && IGameMode::m_CTF == mode->ModeType() ) {
				CTFGameMode *ctf = static_cast<CTFGameMode *>(mode);
				Handle<IImage> intelIcon = renderer->RegisterImage("Gfx/Map/Intel.png");
				Handle<IImage> baseIcon = renderer->RegisterImage("Gfx/Map/CommandPost.png");
				for(int tId = 0; tId < 2; tId++){
					CTFGameMode::Team& team = ctf->GetTeam(tId);
					IntVector3 teamColor = world->GetTeam(tId).color;
					Vector4 teamColorF = ModifyColor(teamColor);
					teamColorF *= alpha;
					
					// draw base
					renderer->SetColorAlphaPremultiplied(teamColorF);
					DrawIcon(team.basePos, baseIcon, 0.f);
					
					
					// draw flag
					if(!ctf->GetTeam(1-tId).hasIntel){
						renderer->SetColorAlphaPremultiplied(teamColorF);
						DrawIcon(team.flagPos, intelIcon, 0.f);
					}else if(world->GetLocalPlayer()->GetTeamId() == 1-tId){
						// local player's team is carrying
						int cId = ctf->GetTeam(1-tId).carrier;
						
						// in some game modes, carrier becomes invalid
						if(cId < world->GetNumPlayerSlots()){
							Player * carrier= world->GetPlayer(cId);
							if(carrier && carrier->GetTeamId() ==
							   world->GetLocalPlayer()->GetTeamId()){
								
								Vector4 col = teamColorF;
								col *= fabsf(sinf(world->GetTime() * 4.f));
								renderer->SetColorAlphaPremultiplied(col);
								DrawIcon(carrier->GetPosition(), intelIcon, 0.f);
							}
						}
					}
				}
			} else if( mode && IGameMode::m_TC == mode->ModeType() ) {
				TCGameMode *tc = static_cast<TCGameMode *>(mode);
				Handle<IImage> icon = renderer->RegisterImage("Gfx/Map/CommandPost.png");
				int cnt = tc->GetNumTerritories();
				for(int i = 0; i < cnt; i++){
					TCGameMode::Territory *t = tc->GetTerritory(i);
					IntVector3 teamColor = {128,128,128};
					if(t->ownerTeamId < 2){
						teamColor = world->GetTeam(t->ownerTeamId).color;
					}
					Vector4 teamColorF = ModifyColor(teamColor);
					teamColorF *= alpha;
					
					// draw base
					renderer->SetColorAlphaPremultiplied(teamColorF);
					DrawIcon(t->pos, icon, 0.f);
					
				}
			}
		}
	}
}
Therefore, a problem is removed, I ask you just a little help with the issue of icons.
LeCom:Secondly, did you even read the first line of your log? :P
yes
i've read it, then the problem is that I do not put the icon called Player.png in the right place, but I just can not figure it out.
Please anyone knows:
Where should I put the icon i want to represent the player.
If there are special measures to achieve this icon with GIMP.
And any other relevant information to customize the icon Player.png.
I repeat again the purpose:
I want to use 3 different icons depending on the equipped weapon (rifle, SMG, Shootgun)
LeCom
Post Demon
Post Demon
Posts: 866
Joined: Sat May 24, 2014 8:07 am


so, putting one into Gfx/Map/a2.png doesn't help? What path did you set for OpenSpades to load the 3 player icons then?
pandaro
Deuced Up
Posts: 26
Joined: Wed Jun 04, 2014 8:06 am


LeCom wrote:
so, putting one into Gfx/Map/a2.png doesn't help? What path did you set for OpenSpades to load the 3 player icons then?
Abstract: I use Linux
The situation right now is that ALL work if I put the three icons in the folder: ~ /.local/share/openspades/Resources/Gfx/Map/
At compile time openspades shall create the folder: ~/.local/share/openspades/Resources
So I have to provide, for the installation is finished, I manually create other folders that are missing, and put the images inside.

Now I will explain that:
when you download openspades, you must extract the compressed package and create inside a folder "openspades.mk". To install openspades must move (from a terminal) in just openspades.mk and type "cmake .. -DCMAKE_BUILD_TYPE = && Release make ".
The first thing I will do is to check if openspades inside openspades.mk/Resources there is a package called: "DevPaks27.zip"

Since it is not present, neither the folder nor the package, openspades will create the folder and download the "DevPaks27.zip" from internet repository.
Inside "DevPaks27.zip" There are five packages .pak.
inside pak000-Base.pak there /Gfx/Map/Player.png
Whatever I do, rename Player.png, sobstitute Player.png, or whatever. Once all recompressed and recompiled openspades, openspades crash before spawn, with the error that I wrote above:
Code: Select all
2015/01/20 13:16:29 [MainScreen.cpp:246] [!] Error while running a game client: File not found: Gfx/Map/a2.png
So I am pretty sure that the place where they belong icons is what I said before.
In Conclusion: I can not understand how to make it work.

Now the good news
The codification work is practically finished and aside some trick to properly install openspades everything works perfectly.
to demonstrate this first place is a screenshot:
Image
as you can see, there are arrows (SMG) of the "T" (rifles) and triangles (Shotgun)
each player is identified by a different color
And you can figure out which color represents which gicatore pressing the TAB key, the connection number of each player is colored the same color of the icon on the minimap.

instead of this address you can download and try openspades, modified by me:
https://www.dropbox.com/s/w180ug0lw2hcc ... ar.gz?dl=0

I remind you that all your compliments are to do in ivthttps://github.com/yvt/openspadesWithout which openspades not exist and I could not have done anything


installation is the same openspades,
Once the installation is finished, inside the folder openspades-0.0.12/Gfx/Map you find 3 icons.
put it in ~/.local/Share/openspades/Resources/Gfx/Map
If the folder does not exist:create it
Icarus North
Green Master Race
Green Master Race
Posts: 578
Joined: Sat Aug 30, 2014 11:16 pm


Green_Welcome It looks like an interesting idea, but not enough intelligent players play AoS classic anymore, many less of which use this forum.

Green_OffTopic It's a real shame because I keep coming back to this game for its simplicity and (gawk at me all you want.) strategic creativity.

Green_Question I might try it, saying I've managed to make my OpenSpades client go to about 47 FPS.

Green_Arrow First, however, I think you could improve on this. The letters are ENORMOUS on the map, which can make enemies and objectives much less visible. AT LEAST reduce the size, but letters are lame and I'd actually want to see a cool player model.

Green_Arrow Also, for the color system. If you designed your modification to assign a color to a specific number, that would be really cool. Of course, I would also want those colors to change every time you join a server.

Green_Arrow Do you think you can bring tracers back to the map and the minimap?
8 posts Page 1 of 1
Return to “OpenSpades Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests