Map editor


#41

Still the same, as long time ago…
http://imgup.pl/di/MU6J/no-edytor.png
Maybe something wrong with my graphics card or drivers?
http://imgup.pl/di/VFML/karta.png


#42

Boats still rotating:-)

I looked into sources, I think there is possibility of easy modding in adding new terrains.

  TTerrainGroup = (
    NORMAL,
    DIRT,
    SAND,
    WATER,
    ROCK);

const

  TERRAIN_GROUPS: array [TTerrainType] of TTerrainGroup = (
   TTerrainGroup.DIRT,
   TTerrainGroup.SAND,
   TTerrainGroup.NORMAL,
   TTerrainGroup.NORMAL,
   TTerrainGroup.NORMAL,
   TTerrainGroup.NORMAL,
   TTerrainGroup.NORMAL,
   TTerrainGroup.NORMAL,
   TTerrainGroup.WATER,
   TTerrainGroup.ROCK);


  TERRAIN_DEF_FILES: array[TTerrainType] of string = (
    'DIRTTL',
    'SANDTL',
    'GRASTL',
    'SNOWTL',
    'SWMPTL',
    'ROUGTL',
    'SUBBTL',
    'LAVATL',
    'WATRTL',
    'ROCKTL'
    );

Firstly, instead of using arrays and getting information from different arrays by index, maybe it’s better to use structures?
TTerrainGroup, as I think is a type of terrain (determined by number of frames in def and their align to other terrains).
Am I right, that to add new terrain all is needed:
add new def file path to TERRAIN_DEF_FILES: ‘terrains/cool_terrain.def’, and add TERRAIN_GROUPS : ?
And of cause text name of terrain.

So my proposition:
we have terrains.json:

{
	"dirt" :
	{
		"moveCost" : 100,
		"minimapUnblocked" :  82, 56, 8 ],
		"minimapBlocked"   :  57, 40, 8 ],
		"music" : "Dirt.mp3"
	},
	"sand" :
	{
		"moveCost" : 150,
		"minimapUnblocked" :  222, 207, 140 ],
		"minimapBlocked"   :  165, 158, 107 ],
		"music" : "Sand.mp3"
	},
	"grass" :
	{
		"moveCost" : 100,
		"minimapUnblocked" :  0, 65, 0 ],
		"minimapBlocked"   :  0, 48, 0 ],
		"music" : "Grass.mp3"
	},
	"snow" :
	{
		"moveCost" : 150,
		"minimapUnblocked" :  181, 199, 198 ],
		"minimapBlocked"   :  140, 158, 156 ],
		"music" : "Snow.mp3"
	},
	"swamp" :
	{
		"moveCost" : 175,
		"minimapUnblocked" :  74, 134, 107 ],
		"minimapBlocked"   :  33,  89,  66 ],
		"music" : "Swamp.mp3"
	},
	"rough" :
	{
		"moveCost" : 125,
		"minimapUnblocked" :  132, 113, 49 ],
		"minimapBlocked"   :   99,  81, 33 ],
		"music" : "Rough.mp3"
	},
	"subterra" :
	{
		"moveCost" : 100,
		"minimapUnblocked" :  132, 48, 0 ],
		"minimapBlocked"   :   90,  8, 0 ],
		"music" : "Underground.mp3"
	},
	"lava" :
	{
		"moveCost" : 100,
		"minimapUnblocked" :  74, 73, 74 ],
		"minimapBlocked"   :  41, 40, 41 ],
		"music" : "Lava.mp3"
	},
	"water" :
	{
		"moveCost" : 100,
		"minimapUnblocked" :  8, 81, 148 ],
		"minimapBlocked"   :  8, 81, 148 ],
		"music" : "Water.mp3"
	},
	"rock" :
	{
		"moveCost" : -1,
		"minimapUnblocked" :  0, 0, 0 ],
		"minimapBlocked"   :  0, 0, 0 ],
		"music" : "Underground.mp3" // Impossible in H3
	}
}

So add to every terrain fields:
“animation” : “path to def”,
“terrainType” : “NORMAL”, (or “DIRT”, “SAND”, “WATER”, “ROCK”)
“name” : “Lava Lake”,

And editor will not use hardcoded arrays, but will load terrains.json and use this info when working with terrain.
Of cause, on VCMI side terrains.json additional information must also then used by RMG and game engine.


#43

Yes it`s definitely opengl problem, but required version 3.3 is supported by your device. What is in editor.log?


#44

[spoiler]

Version: 3.3.11672 Compatibility Profile Context
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon 3000 Graphics
Glsl: 3.30
Loading mod vcmi
Loading mod vcmi.bonusicons
Loading mod vcmi.defaulttemplates
Loading mod vcmi.defaulttemplates.analogy
Loading mod vcmi.defaulttemplates.clash of dragons
Loading mod vcmi.defaulttemplates.coldshadows fantasy
Loading mod vcmi.defaulttemplates.golden ring
Loading mod vcmi.defaulttemplates.jebus cross
Loading mod vcmi.defaulttemplates.upgrade
Loading mod vcmi.extraresolutions
Loading mod wog
Loading mod wog.commanders
Loading mod wog.stackarts
Loading mod wog.stackexp
Loading mod wog.wog rus
Loading factions
0 Neutral
1   ArA_SeBr.pcx ĚĚĚ`b! Ś     ş
2   ArA_SeBl.pcx ĚĚĚÁT! Ś     ź
3   ArA_EnVi.pcx ĚĚĚG! Ś     Ş
4   ArA_EnTe.pcx ĚĚĚ@9! Ś     ×
5   ArA_EnPi.pcx ĚĚĚŁ! Ś     ď
6   ArA_EnRe.pcx ĚĚĚ’+! Ś     ®
7   ArA_EnOr.pcx ĚĚĚÁ! Ś     â
8   ArA_EnBr.pcx ĚĚĚđó  Ś       ArA_EnGr.pcx ĚĚĚ! Ś     »
9 LOD ô  .                                                                                  ADOPBPNL.PCX ĚĚĚ\â \C     ß$  ADOPFLGB.PCX ĚĚĚ;a ŕ
unused legacy data 0 0
unused legacy data 63 3
unused legacy data 63 4
unused legacy data 63 5
unused legacy data 63 6
unused legacy data 63 7
unused legacy data 63 8
unused legacy data 63 9
unused legacy data 63 14
unused legacy data 63 15
unused legacy data 63 16
unused legacy data 63 17
unused legacy data 63 18
unused legacy data 63 19
unused legacy data 63 20
unused legacy data 63 21
unused legacy data 63 22
unused legacy data 63 23
unused legacy data 63 24
unused legacy data 63 25
unused legacy data 63 26
unused legacy data 63 27
unused legacy data 63 28
unused legacy data 63 29
unused legacy data 63 30
unused legacy data 63 31
unused legacy data 63 32
unused legacy data 63 33
unused legacy data 63 34
unused legacy data 63 35
unused legacy data 63 36
unused legacy data 63 37
unused legacy data 63 38
unused legacy data 63 39
unused legacy data 63 40
unused legacy data 63 41
unused legacy data 63 42
unused legacy data 63 43
unused legacy data 63 44
unused legacy data 63 45
unused legacy data 63 46
unused legacy data 63 47
unused legacy data 63 48
unused legacy data 63 49
unused legacy data 63 50
unused legacy data 63 51
unused legacy data 63 52
unused legacy data 63 53
unused legacy data 63 54
unused legacy data 63 55
unused legacy data 63 56
unused legacy data 63 57
unused legacy data 63 58
unused legacy data 63 59
unused legacy data 63 60
unused legacy data 63 61
unused legacy data 63 62
unused legacy data 40 0
unused legacy data 41 1
unused legacy data 101 1
unused legacy data 101 2
unused legacy data 101 3
unused legacy data 101 4
unused legacy data 101 5
unused legacy data 101 6
unused legacy data 101 7
unused legacy data 101 8
unused legacy data 101 9
unused legacy data 101 10
unused legacy data 63 2
unused legacy data 63 1
unused legacy data 95 1
unused legacy data 63 10
unused legacy data 63 11
unused legacy data 63 12
unused legacy data 63 13
unused legacy data 63 63
unused legacy data 63 64
unused legacy data 63 65
unused legacy data 63 66
unused legacy data 63 67
unused legacy data 63 68
unused legacy data 63 69
unused legacy data 63 70
unused legacy data 63 71
unused legacy data 63 72
unused legacy data 63 73
unused legacy data 63 74
	Subtype spellScroll has "base" but no templates
	Subtype wog:art144 has "base" but no templates
	Subtype wog:art145 has "base" but no templates
	Subtype unused122 has "base" but no templates
	Subtype unused124 has "base" but no templates
	Subtype unused126 has "base" but no templates
	Subtype unused128 has "base" but no templates
	Subtype catapult has "base" but no templates
	Subtype ballista has "base" but no templates
	Subtype firstAidTent has "base" but no templates
	Subtype ammoCart has "base" but no templates
	Subtype arrowTower has "base" but no templates
	Subtype wog:godWar has "base" but no templates
	Subtype wog:godPeace has "base" but no templates
	Subtype wog:godMana has "base" but no templates
	Subtype wog:godLore has "base" but no templates
	Subtype wog:paladin1 has "base" but no templates
	Subtype wog:hierophant1 has "base" but no templates
	Subtype wog:templeGuardian1 has "base" but no templates
	Subtype wog:succubus1 has "base" but no templates
	Subtype wog:soulEater1 has "base" but no templates
	Subtype wog:brute1 has "base" but no templates
	Subtype wog:ogreLeader1 has "base" but no templates
	Subtype wog:shaman1 has "base" but no templates
	Subtype wog:astralSpirit1 has "base" but no templates
	Subtype wog:paladin2 has "base" but no templates
	Subtype wog:hierophant2 has "base" but no templates
	Subtype wog:templeGuardian2 has "base" but no templates
	Subtype wog:succubus2 has "base" but no templates
	Subtype wog:soulEater2 has "base" but no templates
	Subtype wog:brute2 has "base" but no templates
	Subtype wog:ogreLeader2 has "base" but no templates
	Subtype wog:shaman2 has "base" but no templates
	Subtype wog:astralSpirit2 has "base" but no templates
	Subtype object has no templates
	Subtype object has no templates
	Subtype object has no templates
	Subtype object has no templates

[/spoiler]


#45

Completely forgot them :slight_smile:

I`m afraid VCMI will need much more changes. Editor propably just need Terrain codes in addition to your example.


#46

No GL errors

This is weird junk - may be some locale-specific bug. Everything else looks normal.


#47

There is no driver version after “Compatibility Profile Context”, install AMD Catalyst drivers.


#48

With something easy we need to start:-)
I installed Lazarus and compiled csvdocument package.
Then I make “Build” and get exe-file in bin subdirectory.
But when I copy it to VCMI folder and run, it gives error like on picture.
Is there some tricks in Lazarus, not just load and compile lpr-file?


#49

After reinstal drivers still the same.


#50

May be you compiled 64bit version of editor, it will not work with 32bit vcmi (or vice versa) w|o some tricks. Or you`ve built “profile” build mode version .


#51

Exact version of drivers?


#52

http://imgup.pl/di/34Y4/daha.png


#53

I need to add more precise OpenGl extensions check. Also can you provide more detail OpenGl information? I suppose Everest has more on that screen.


#54

It’s all from opengl
paste.ofcode.org/wpXJgL4js4HyfMVy3p5dVG


#55

That is not your bug. It’s OpenGL DLLs corrupted on drivers install.


#56

Nothing suspicious :frowning: I`m sure that one extension is missing or bugged but cant find it.


#57

UPD: Oops, messed up Macron1 screenshot with your one. :blush:

Though I don’t think it’s have anything to do with extensions. AMD legacy drivers buggy as hell and their 3.3 support especially buggy.


#58

Yes, you were right. Browser got me link for 64-bit Lazarus.
I installed 32-bit also and it now works.

I managed to add new terrain def file to editor. In main.lfm there are hardcoded buttons, i added another ‘F.Wat.’ button.
So these buttons need to be created in run-time (not in lfm).



#59

@edeksumo The solution is too ship llvmpipe gl diver.

@SXX where did you get that binary version (“opengl32sw.dll”)? Is there any newer with GLSL 3.30? But I can make it works with GLSL 1.30.


#60

You can use any version of Lazarus. Just do not forget to setup Target platform in project options and have crosscompiler addon installed.