Huge patch from viktor muraviev

Huge patch from viktor muraviev

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Huge patch from viktor muraviev

Post by jcnossen »

A guy named viktor muraviev made a huge code contribution to spring. Among the changes are saving/loading, even for AI's.

This is his changelog.

Code: Select all

In Spring.exe:

-Bug fix:Objects with equal address in CReg                                     (Serializer.h,Serializer.cpp)
-Bug fix:Serializing of Synched***                                              (VarTypes.cpp)
-set<class *> replaced by list<class *> in serializable classes                 (CObject.h,CObject.cpp,FeatureHandler.h,FeatureHandler.cpp,UnitHandler.h,UnitHandler.cpp,
-Added/fixed CReg metadata registration                                         (GlobalStuff.h,GlobalStuff.cpp,Feature.h,Feature.cpp,FeatureHandler.h,FeatureHandler.cpp,
-Fixed bug with death dependances from nonserialized CObject-based classes      (CObject.cpp)
-Reduced save size                                                              (LosHandler.h,LosHandler.cpp)
-Replaced type* by vector<type>                                                 (LosHandler.h,LosHandler.cpp,RadarHandler.h,RadarHandler.cpp,QuadField.h,QuadField.cpp,UnitHandler.h,
-Load/Save fixed                                                                (LoadScript.h,LoadScript.cpp)
-Directory for saves                                                            (Game.cpp,LoadScript.cpp)
-F8 now save to QuickSave.ssf                                                   (Game.cpp)
-Added game command .save [-y ]<savename>                                       (Game.cpp,WordCompletion.cpp)
-Added Save/Load interface for AI(ai versions incremented)                      (GlobalAI.h,GlobalAI.cpp,GlobalAIHandler.h,GlobalAIHandler.cpp,GroupHandler.h,GroupHandler.cpp,IGlobalAI.h,IGroupAI.h)

-Added metal/energy storade to CUnit                                            (Unit.h,Unit.cpp,CommanderScript.cpp)
-Fixed possible bug with time profiler                                          (UnitLoader.cpp)
-Added Land at 80 for air units (doesn't work)                                  (AirCAI.cpp)
-Ground flashes can be permanent                                                (GroundFlash.cpp)
-Log message text instead Loading step... (for save/load screen)                (myGL.cpp)
-Added CScript::ScriptSelected                                                  (Script.h,Script.cpp,LoadScript.h,LoadScript.cpp)
-Edited camera                                                                  (CameraController.cpp)
-Main camera draw moved from CGame::Draw to CGame::DrawWorld                    (Game.h,Game.cpp)
-Added group handler per team                                                   (Game.cpp,SelectedUnits.cpp,LuaUI.cpp,GlobalAICallback.cpp,AICallback.cpp,GroupHandler.cpp,GlobalAI.h,GlobalAI.cpp)
-Added max time diff                                                            (Game.cpp,GameServer.cpp)
-Added time profiling for draw                                                  (Game.cpp)
-Fixed load from CPreGame(doesn't work)                                         (PreGame.cpp)
-In end game box hide second stat by default                                    (EndGameBox.cpp)
-Draw minimap before interface                                                  (Game.cpp)
-Don't draw main camera if minimap is maximized                                 (Game.cpp,MiniMap.h,MiniMap.cpp)
-Added GetStartPos to CAICallback                                               (AICallback.h,AICallback.cpp,IAICallback.h)
-Fixed CCommandQueue in ai interface                                            (AICallback.h,IAICallback.h)
-Hide gaia team                                                                 (QuitBox.cpp,ShareBox.cpp)
-Add - between unit name and description                                        (SelectionKeyHandler.cpp)

-Added windows SEH support                                                      (main.cpp,seh.cpp,seh.h)
-Use crashrpt instead crashreport                                               (main.cpp)
-SimplePositiveInfinity from <limits> (temp)                                    (lmathlib.cpp) 
-Delete #include<math.h>                                                        (FontTexture.cpp)
-Streflop math.h renamed to smath.h                                             (smath.h,streflop.h,e_***.cpp)
-Removed CUnit::loaded from c# interface                                        (IUnitDef.cs,IUnitDef_generated.h,IUnitDef_generated.cpp)

GroupAI and GlobalTestAI sln converted to vs8
Changes in AAI and KAI-0.22
Added save/load support to KAI-0.22,EconomyAI,MexUpgraderAI

RadarHandler from old NTAI copied to KAI-0.22                                   (CoverageHandler.h,CoverageHandler.cpp)

sln converted to vs8

-Add save/load support for other global ais
-Add save/load for COB
-Add save/load for start scripts
-Add save/load for CGameSetup(for load from pre-game menu)
-Add save/load for restrictions

Save/Load now works only through CGameSetup scripts(ScriptName=Load ***.ssf)

Unfortunately replies to his email get bounced and he sent us just a big with all the code. If you're reading this viktor, can you do further contributions by sending svn patches? :)

I've converted it to a large patch ( ... trib.patch) (801k !), maybe someone else can take a look at it, split it up, commit it... because I have exams in 2 days

Since otherwise noone probably wanted to fix my saving code including me, this is a really big thing.

EDIT: Tested the saving without AIs, it works fine.
Last edited by jcnossen on 19 Jun 2007, 15:39, edited 2 times in total.
User avatar
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Last edited by jcnossen on 19 Jun 2007, 16:03, edited 1 time in total.
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy »

Wow, contributing something that big & basically anonymously is weird. Well at that's 1 down from MTR (if it's even in there). If you reading this viktor; Thanks!
(maybe it's someone already in the community, and that's his real name?)
User avatar
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Compiled version (KAI 0.22 and Spring both with saving support)
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy »

jcnossen wrote:Compiled version (KAI 0.22 and Spring both with saving support)
Bah... windows :P
Posts: 205
Joined: 01 May 2006, 11:35

Post by espylaub »

Eh, wait. If saving is possible, resynching should be simple now, no?
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX »

I just wanna say: thank you, Viktor.. :D
User avatar
Posts: 1394
Joined: 05 Oct 2004, 01:05

Post by clericvash »

Wow i don't know what half of it means but the half i do it was a great patch, that is pretty cool!
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy »

espylaub wrote:Eh, wait. If saving is possible, resynching should be simple now, no?
Ooohh.. might indeed be (it's the loading part that was the problem; we've been able to save for a long time now)
User avatar
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

<3 Thanks Viktor! <3
User avatar
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Sounds like good news to me.
User avatar
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

The only weird thing so far is that he changed lots of std::set uses to std::list, which will slow down the game a lot when there are a lot of units. Otherwise its all good code.
User avatar
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »


How anonymous.. O.o
User avatar
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie »

Viktor... hurm, thank you very much for your work.
User avatar
Posts: 439
Joined: 14 Oct 2005, 12:09

Post by BvDorp »

LOL, funneh thing

Tobi, can you comment on the saving/loading/resyncing thing?
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

I will take a look at it soonish.
Posts: 933
Joined: 27 Feb 2006, 02:04

Post by el_matarife »

If this patch makes resync possible for .75 I suggest we include a massive shout out to this guy on the front page when it is released. This is amazingly impressive work. If he shows up at QuakeCon or something I will buy him dinner and drinks.
User avatar
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 »

Tell this dude "thanks"...

again, really fantastic. I wouldn't be averse to buying him a lunch or something if he showed up to my university :)
User avatar
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Wow, he fixed a number of things! Hope the patch is good, it sure looks like he addressed a bunch of niggling issues for 0.75! Hope we see more from him at some point!
Post Reply

Return to “Engine”