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
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Huge patch from viktor muraviev

Post by jcnossen » 19 Jun 2007, 15:32

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,
                                                                                 UnitTracker.cpp,PlasmaRepulser.h,PlasmaRepulser.cpp,LuaSyncedCtrl.cpp,LuaSyncedRead.cpp,
                                                                                 LuaUnsyncedRead.cpp,SpawnScript.cpp,Game.h,Game.cpp,SelectedUnits.h,SelectedUnits.cpp,Team.h,Team.cpp
                                                                                 WaitCommandsAI.h,WaitCommandsAI.cpp,MiniMap.cpp,MouseHandler.cpp,SelectionKeyHandler.cpp)
-Added/fixed CReg metadata registration                                         (GlobalStuff.h,GlobalStuff.cpp,Feature.h,Feature.cpp,FeatureHandler.h,FeatureHandler.cpp,
                                                                                 TAAirMoveType.h,TAAirMoveType.cpp,AirMoveType.cpp,groundmovetype.cpp,ScriptMoveType.cpp,
                                                                                 BeamLaserProjectile.cpp,EmgProjectile.cpp,ExplosionGenerator.h,ExplosionGenerator.cpp,
                                                                                 FireBallProjectile.cpp,FlameProjectile.cpp,FlareProjectile.h,FlareProjectile.cpp,
                                                                                 LargeBeamLaserProjectile.cpp,LaserProjectile.cpp,MissileProjectile.cpp,MuzzleFlame.h,
                                                                                 MuzzleFlame.cpp,PieceProjectile.h,PieceProjectile.cpp,ProjectileHandler.h,ProjectileHandler.cpp,
                                                                                 RepulseGfx.cpp,ShieldPartProjectile.cpp,StarburstProjectile.cpp,WeaponProjectile.h,WeaponProjectile.cpp,
                                                                                 WreckProjectile.h,WreckProjectile.cpp,Unit.h,Unit.cpp,AirCAI.h,AirCAI.cpp,BuilderCAI.h,BuilderCAI.cpp,
                                                                                 CommandAI.h,CommandAI.cpp,CommandQueue.h,FactoryCAI.h,FactoryCAI.cpp,MobileCAI.h,MobileCAI.cpp,
                                                                                 TransportCAI.h,TransportCAI.cpp,Builder.h,Builder.cpp,Building.h,Building.cpp,ExtractorBuilding.h,
                                                                                 ExtractorBuilding.cpp,Factory.h,Factory.cpp,TransportUnit.h,TransportUnit.cpp,bombdropper.cpp,
                                                                                 TorpedoLauncher.cpp,Weapon.cpp,GroundFlash.h,GroundFlash.cpp,MetalMap.h,MetalMap.cpp,command.h,
                                                                                 command.cpp,Game.h,Game.cpp,Player.h,Player.cpp,Team.h,Team.cpp,aikey.h,GlobalAI.h,GlobalAI.cpp,
                                                                                 GlobalAIHandler.h,GlobalAIHandler.cpp,Group.h,Group.cpp,GroupHandler.h,GroupHandler.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,
                                                                                 UnitHandler.cpp,MetalMap.h,MetalMap.cpp,ReadMap.h,ReadMap.cpp,BaseGroundDrawer.cpp,GuiHandler.cpp,
                                                                                 AICallback.h,AICallback.cpp,)
-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)

AI:
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)

CrashRpt:
sln converted to vs8


TODO:
-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 spring.zip 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 (http://user.supradigital.org/jcnossen/V ... 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.
0 x

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

Post by jcnossen » 19 Jun 2007, 15:36

Last edited by jcnossen on 19 Jun 2007, 16:03, edited 1 time in total.
0 x

Lippy
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy » 19 Jun 2007, 16:00

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?)
0 x

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

Post by jcnossen » 19 Jun 2007, 16:02

Compiled version (KAI 0.22 and Spring both with saving support)
Image
0 x

Lippy
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy » 19 Jun 2007, 16:07

jcnossen wrote:Compiled version (KAI 0.22 and Spring both with saving support)
Image
Bah... windows :P
0 x

espylaub
Posts: 205
Joined: 01 May 2006, 11:35

Post by espylaub » 19 Jun 2007, 16:16

Eh, wait. If saving is possible, resynching should be simple now, no?
0 x

MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

Post by MelTraX » 19 Jun 2007, 16:19

I just wanna say: thank you, Viktor.. :D
0 x

User avatar
clericvash
Posts: 1394
Joined: 05 Oct 2004, 01:05

Post by clericvash » 19 Jun 2007, 16:24

Wow i don't know what half of it means but the half i do it was a great patch, that is pretty cool!
0 x

Lippy
Posts: 327
Joined: 16 Jul 2006, 00:24

Post by Lippy » 19 Jun 2007, 16:33

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)
0 x

User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum » 19 Jun 2007, 16:45

<3 Thanks Viktor! <3
0 x

User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle » 19 Jun 2007, 16:58

Sounds like good news to me.
0 x

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

Post by jcnossen » 19 Jun 2007, 17:40

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.
0 x

Kloot
Spring Developer
Posts: 1865
Joined: 08 Oct 2006, 16:58

Post by Kloot » 19 Jun 2007, 18:10

0 x

User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf » 19 Jun 2007, 19:14

Nice..

How anonymous.. O.o
0 x

User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Post by Neddie » 19 Jun 2007, 23:10

Viktor... hurm, thank you very much for your work.
0 x

User avatar
BvDorp
Posts: 439
Joined: 14 Oct 2005, 12:09

Post by BvDorp » 19 Jun 2007, 23:35

LOL, funneh thing

Tobi, can you comment on the saving/loading/resyncing thing?
0 x

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi » 20 Jun 2007, 00:20

I will take a look at it soonish.
0 x

el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Post by el_matarife » 20 Jun 2007, 07:31

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.
0 x

User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Post by Dragon45 » 20 Jun 2007, 07:58

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 :)
0 x

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh » 20 Jun 2007, 08:14

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!
0 x

Post Reply

Return to “Engine”

cron