SlideShare a Scribd company logo
1 of 59
Introduction
From GameMaker to GameBaker
Porting Hotline Miami
Frans Kasper, Control Conference 2015
Introduction
• Introduction
• Porting at Abstraction Games
• SilverWare
• Hotline Miami Ports
Frans Kasper, Control Conference 2015
Porting at Abstraction
Frans Kasper, Control Conference 2015
• Introduction
• Porting at Abstraction Games
• SilverWare
• Hotline Miami Ports
Porting at Abstraction
• Remakes
• Use original code mostly as reference
• May re-use assets
Frans Kasper, Control Conference 2015
Porting at Abstraction
• Ports
• Use original code directly
• Use existing assets and toolchains
• May need language-to-language conversions
Frans Kasper, Control Conference 2015
Porting at Abstraction
• Emulations
• Use original binaries and content as-is
Frans Kasper, Control Conference 2015
Porting at Abstraction
• Normalization
• Convert to cross-platform framework
• Hide platform specifics from game/engine
• Improve shared technology constantly
• Can do most development without devkits
Frans Kasper, Control Conference 2015
Porting at Abstraction
• ‘Black Box’ ports
• Use closed-source and unsupported technology
• Require reverse engineering
• May require language-to-language conversions
Frans Kasper, Control Conference 2015
Porting at Abstraction
• Adaptation
• Tailoring Controls & UI
• Platform-Specific Features
• Quality Assurance & First Party Submissions
• “Best on Vita”
Frans Kasper, Control Conference 2015
SilverWare
Frans Kasper, Control Conference 2015
• Introduction
• Porting at Abstraction Games
• SilverWare
• Hotline Miami Ports
SilverWare
• Cross-Platform C++ Library for Porting
• SDK for a ‘virtual platform’
• Modeled after low-level libraries
• Not a game engine
• Not strictly low-level
Frans Kasper, Control Conference 2015
Hotline Miami
Frans Kasper, Control Conference 2015
• Introduction
• Porting at Abstraction Games
• SilverWare
• Hotline Miami Ports
DataConversion
Frans Kasper, Control Conference 2015
• GameMaker Data
• Fonts
• Sounds
• Sprites
• Backgrounds (‘Tilesets’)
• Objects (‘Classes’)
• Rooms (‘Levels’)
• Scripts (‘Functions’)
• Encoded in single binary .GMK file.
Hotline Miami
Frans Kasper, Control Conference 2015
DataConversion
Frans Kasper, Control Conference 2015
• Data Conversion
• Code Conversion
• Architecture
• Pros & Cons
DataConversion
Frans Kasper, Control Conference 2015
• ENIGMA
• C# Tools
• Export data to generic format
• Resources as PNG, WAV, Bitmap Font, etc.
• Other data as 1:1 memory-mapped tables.
DataConversion
Frans Kasper, Control Conference 2015
DataConversion
Frans Kasper, Control Conference 2015
CodeConversion
Frans Kasper, Control Conference 2015
• Data Conversion
• Code Conversion
• Architecture
• Pros & Cons
CodeConversion- IRONY
• IRONY.NET Language Implementation Kit
• ‘Development Kit for Implementing Languages’.
• Write grammar directly in C#.
• No specialized Scanner/Parser language.
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// IRONY.NET grammar definition example
switch_statement.Rule = "switch" + expression + Lbr + switch_sections_opt + Rbr;
switch_section.Rule = switch_labels + statement_list;
switch_sections_opt.Rule = MakeStarRule(switch_sections_opt, null, switch_section);
case_statement.Rule = "case" + expression + colon;
switch_label.Rule = case_statement | "default" + colon;
switch_labels.Rule = MakePlusRule(switch_labels, null, switch_label);
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
CodeConversion- IRONY
// IRONY.NET AST Node Example
public class SwitchNode : BlockStatement
{
public override void Init(Irony.Ast.AstContext context, ParseTreeNode treeNode)
{
// basic initialization
base.Init(context, treeNode);
// get all AST nodes inside the switch parentheses.
var nodes = treeNode.GetMappedChildNodes();
// output C++ code to be generated.
CCode = "switch" + "( " + GetCCode(nodes[0]) + ".GetSwitchValue() )";
}
}
Frans Kasper, Control Conference 2015
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
PGMLVar test;
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
PGMLVar test;
switch ( _instance->Get( var_myMember ).GetSwitchValue() )
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
PGMLVar test;
switch ( _instance->Get( var_myMember ).GetSwitchValue() )
{
case 0:
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
PGMLVar test;
switch ( _instance->Get( var_myMember ).GetSwitchValue() )
{
case 0:
_instance->GetInstanceVar< var_x >() = test;
break;
}
CodeConversion- IRONY
// Code Sample
var test;
switch ( myMember )
{
case 0:
x = test;
break;
}
PGMLVar test;
switch ( _instance->Get( var_myMember ).GetSwitchValue() )
{
case 0:
_instance->GetInstanceVar< var_x >() = test;
break;
}
CodeConversion- C++
• C++ Implementation
• GMLVar to emulate variable behavior
• Built-in functionality mirrored
• Scripts
• Execution Flow
• Resource Management
• Etc.
• Compile converted code as usual
Frans Kasper, Control Conference 2015
CodeConversion
• Edge Cases & Pitfalls
• Non Orthogonal
• Complex Variables
• ‘With’ statement
Frans Kasper, Control Conference 2015
CodeConversion
GML
// scrScriptTest
var test = 0;
switch ( argument0 )
{
case 0:
x = test; // local var
y = myMember; // member var
break;
case "test":
t = global.test; // global var
w = objTest.test; // object var
break;
}
C++
void scrScriptTest( GMLObjectInstance* _instance, GMLObjectInstance* _other, const PGMLVar& argument0 )
{
PGMLVar test = (GMLReal)0;
switch ( argument0.GetSwitchValue() ) // returns hash for string types
{
case 0:
_instance->GetInstanceVar< var_x >() = test;
_instance->GetInstanceVar< var_y >() = _instance->Get( var_myMember );
break;
case 663880771: /* test */
_instance->Get( var_t ) = global.Get( var_test );
_instance->Get( var_w ) = g_objTest.Get( var_test );
break;
}
}
Frans Kasper, Control Conference 2015
CodeConversion
GML
// scrScriptTest
var myVar;
globalvar test;
with ( objTest )
{
x = test;
y = myVar;
}
C++
void scrScriptTest( GMLObjectInstance* _instance, GMLObjectInstance* _other )
{
GMLInstances& instances = g_objTest.GetInstances();
for ( GMLInstances::iterator it = instances.begin(); it != instances.end(); it++ )
{
GMLObjectInstance* current = *it;
if ( current->IsDestroyed() )
continue;
current->GetInstanceVar< var_x >() = global.Get( var_test );
current->GetInstanceVar< var_y >() = myVar;
}
}
Frans Kasper, Control Conference 2015
CodeConversion
C++
template< AgUInt32 VarId > class GMLInstanceVar
{
public:
GMLInstanceVar( PGMLVar& refVar, GMLObjectInstance* instance )
: m_refVar( refVar )
{
switch ( VarId )
{
case var_x:
m_refVar = instance->GetX(); // gets current X position
break;
// etc.
}
}
};
Frans Kasper, Control Conference 2015
template< AgUInt32 VarId > class GMLInstanceVar
{
public:
void OnChanged()
{
switch ( VarId )
{
case var_x:
instance->SetX( m_refVar ); // also updates bbox
break;
// etc
}
}
};
C++
Architecture
Frans Kasper, Control Conference 2015
• Data Conversion
• Code Conversion
• Architecture
• Pros & Cons
Architecture
Frans Kasper, Control Conference 2015
Hotline Miami 2
Pros & Cons
Frans Kasper, Control Conference 2015
• Data Conversion
• Code Conversion
• Architecture
• Pros & Cons
Pros & Cons
Frans Kasper, Control Conference 2015
• Pros
• Full Control, No Dependencies
• Better Debugging
• Optimization Opportunities
• Reusable Technology
Pros & Cons
Frans Kasper, Control Conference 2015
• Pros
• Full Control, No Dependencies
• Better Debugging
• Optimization Opportunities
• Reusable Technology
Pros & Cons
Frans Kasper, Control Conference 2015
• Pros
• Full Control, No Dependencies
• Better Debugging
• Optimization Opportunities
• Reusable Technology
Pros & Cons
Frans Kasper, Control Conference 2015
• Pros
• Full Control, No Dependencies
• Better Debugging
• Optimization Opportunities
• Reusable Technology
Pros & Cons
Frans Kasper, Control Conference 2015
• Cons
• Time Intensive
• Never Complete
• Parallel Development Problematic
• Complexity
Pros & Cons
Frans Kasper, Control Conference 2015
• Cons
• Time Intensive
• Never Complete
• Parallel Development Problematic
• Complexity
Pros & Cons
Frans Kasper, Control Conference 2015
• Cons
• Time Intensive
• Never Complete
• Parallel Development Problematic
• Complexity
Pros & Cons
Frans Kasper, Control Conference 2015
• Cons
• Time Intensive
• Never Complete
• Parallel Development Problematic
• Complexity
Takeaways
Frans Kasper, Control Conference 2015
• Introduction
• Porting at Abstraction Games
• SilverWare
• Hotline Miami Ports
Takeaways
• Use the correct tools for the job
• Normalize game & engine code
Frans Kasper, Control Conference 2015
Questions?
• http://www.ctrl500.com/tech/
• http://www.enigma-dev.org
• https://irony.codeplex.com/
• http://www.abstractiongames.com
frans.kasper@abstractiongames.com
@snarfk
@AbstractionGame
Frans Kasper, Control Conference 2015
Porting GameMaker Games to C++ Using Data Conversion and Code Parsing

More Related Content

What's hot

GNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationGNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationAdaCore
 
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)Yunong Xiao
 
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...Lucas Jellema
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsAdaCore
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)Stefan Koopmanschap
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion ApplicationsLuca Pradovera
 

What's hot (8)

Stacking Up Middleware
Stacking Up MiddlewareStacking Up Middleware
Stacking Up Middleware
 
GNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generationGNAT Pro User Day: QGen: Simulink® static verification and code generation
GNAT Pro User Day: QGen: Simulink® static verification and code generation
 
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
 
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
How and Why GraalVM is quickly becoming relevant for developers (ACEs@home - ...
 
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis ToolsGNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
GNAT Pro User Day: Latest Advances in AdaCore Static Analysis Tools
 
The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)The Power Of Refactoring (PHPNW)
The Power Of Refactoring (PHPNW)
 
groovy & grails - lecture 1
groovy & grails - lecture 1groovy & grails - lecture 1
groovy & grails - lecture 1
 
Testing Adhearsion Applications
Testing Adhearsion ApplicationsTesting Adhearsion Applications
Testing Adhearsion Applications
 

Similar to Porting GameMaker Games to C++ Using Data Conversion and Code Parsing

Integrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinIntegrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinDatabricks
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java DevelopersYakov Fain
 
Tech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenTech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenAdaCore
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureQAware GmbH
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLMario-Leander Reimer
 
High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)Arnaud Bouchez
 
Platform as a Runtime - PaaR QCON 2024 - Final
Platform as a Runtime - PaaR QCON 2024 - FinalPlatform as a Runtime - PaaR QCON 2024 - Final
Platform as a Runtime - PaaR QCON 2024 - FinalAviran Mordo
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesPavol Pitoňák
 
APIs for the Internet of Things
APIs for the Internet of ThingsAPIs for the Internet of Things
APIs for the Internet of ThingsKinoma
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Loiane Groner
 
Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020Andrea Scuderi
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldAmazon Web Services
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaAmazon Web Services
 
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...VMworld
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...NETWAYS
 
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...Chris Fregly
 
Optimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AI
Optimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AIOptimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AI
Optimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AIData Con LA
 

Similar to Porting GameMaker Games to C++ Using Data Conversion and Code Parsing (20)

Integrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther KundinIntegrating Existing C++ Libraries into PySpark with Esther Kundin
Integrating Existing C++ Libraries into PySpark with Esther Kundin
 
Dart for Java Developers
Dart for Java DevelopersDart for Java Developers
Dart for Java Developers
 
A First Date With Scala
A First Date With ScalaA First Date With Scala
A First Date With Scala
 
Jug - ecosystem
Jug -  ecosystemJug -  ecosystem
Jug - ecosystem
 
Chti jug - 2018-06-26
Chti jug - 2018-06-26Chti jug - 2018-06-26
Chti jug - 2018-06-26
 
Tech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGenTech Days 2015: Model Based Development with QGen
Tech Days 2015: Model Based Development with QGen
 
Everything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventureEverything-as-code - A polyglot adventure
Everything-as-code - A polyglot adventure
 
Everything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPLEverything-as-code. A polyglot adventure. #DevoxxPL
Everything-as-code. A polyglot adventure. #DevoxxPL
 
High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)High Performance Object Pascal Code on Servers (at EKON 22)
High Performance Object Pascal Code on Servers (at EKON 22)
 
Platform as a Runtime - PaaR QCON 2024 - Final
Platform as a Runtime - PaaR QCON 2024 - FinalPlatform as a Runtime - PaaR QCON 2024 - Final
Platform as a Runtime - PaaR QCON 2024 - Final
 
RichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile DevicesRichFaces - Testing on Mobile Devices
RichFaces - Testing on Mobile Devices
 
APIs for the Internet of Things
APIs for the Internet of ThingsAPIs for the Internet of Things
APIs for the Internet of Things
 
Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018Angular for Java Enterprise Developers: Oracle Code One 2018
Angular for Java Enterprise Developers: Oracle Code One 2018
 
Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020Aws Lambda in Swift - NSLondon - 3rd December 2020
Aws Lambda in Swift - NSLondon - 3rd December 2020
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
VMworld Europe 2014: Taking Reporting and Command Line Automation to the Next...
 
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
stackconf 2020 | The path to a Serverless-native era with Kubernetes by Paolo...
 
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
PipelineAI + AWS SageMaker + Distributed TensorFlow + AI Model Training and S...
 
Optimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AI
Optimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AIOptimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AI
Optimizing, Profiling, and Deploying High Performance Spark ML and TensorFlow AI
 

Recently uploaded

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Porting GameMaker Games to C++ Using Data Conversion and Code Parsing

  • 1.
  • 2. Introduction From GameMaker to GameBaker Porting Hotline Miami Frans Kasper, Control Conference 2015
  • 3. Introduction • Introduction • Porting at Abstraction Games • SilverWare • Hotline Miami Ports Frans Kasper, Control Conference 2015
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Porting at Abstraction Frans Kasper, Control Conference 2015 • Introduction • Porting at Abstraction Games • SilverWare • Hotline Miami Ports
  • 9. Porting at Abstraction • Remakes • Use original code mostly as reference • May re-use assets Frans Kasper, Control Conference 2015
  • 10. Porting at Abstraction • Ports • Use original code directly • Use existing assets and toolchains • May need language-to-language conversions Frans Kasper, Control Conference 2015
  • 11. Porting at Abstraction • Emulations • Use original binaries and content as-is Frans Kasper, Control Conference 2015
  • 12. Porting at Abstraction • Normalization • Convert to cross-platform framework • Hide platform specifics from game/engine • Improve shared technology constantly • Can do most development without devkits Frans Kasper, Control Conference 2015
  • 13. Porting at Abstraction • ‘Black Box’ ports • Use closed-source and unsupported technology • Require reverse engineering • May require language-to-language conversions Frans Kasper, Control Conference 2015
  • 14. Porting at Abstraction • Adaptation • Tailoring Controls & UI • Platform-Specific Features • Quality Assurance & First Party Submissions • “Best on Vita” Frans Kasper, Control Conference 2015
  • 15. SilverWare Frans Kasper, Control Conference 2015 • Introduction • Porting at Abstraction Games • SilverWare • Hotline Miami Ports
  • 16. SilverWare • Cross-Platform C++ Library for Porting • SDK for a ‘virtual platform’ • Modeled after low-level libraries • Not a game engine • Not strictly low-level Frans Kasper, Control Conference 2015
  • 17. Hotline Miami Frans Kasper, Control Conference 2015 • Introduction • Porting at Abstraction Games • SilverWare • Hotline Miami Ports
  • 18. DataConversion Frans Kasper, Control Conference 2015 • GameMaker Data • Fonts • Sounds • Sprites • Backgrounds (‘Tilesets’) • Objects (‘Classes’) • Rooms (‘Levels’) • Scripts (‘Functions’) • Encoded in single binary .GMK file.
  • 19. Hotline Miami Frans Kasper, Control Conference 2015
  • 20. DataConversion Frans Kasper, Control Conference 2015 • Data Conversion • Code Conversion • Architecture • Pros & Cons
  • 21. DataConversion Frans Kasper, Control Conference 2015 • ENIGMA • C# Tools • Export data to generic format • Resources as PNG, WAV, Bitmap Font, etc. • Other data as 1:1 memory-mapped tables.
  • 24. CodeConversion Frans Kasper, Control Conference 2015 • Data Conversion • Code Conversion • Architecture • Pros & Cons
  • 25. CodeConversion- IRONY • IRONY.NET Language Implementation Kit • ‘Development Kit for Implementing Languages’. • Write grammar directly in C#. • No specialized Scanner/Parser language. Frans Kasper, Control Conference 2015
  • 26. CodeConversion- IRONY // IRONY.NET grammar definition example switch_statement.Rule = "switch" + expression + Lbr + switch_sections_opt + Rbr; switch_section.Rule = switch_labels + statement_list; switch_sections_opt.Rule = MakeStarRule(switch_sections_opt, null, switch_section); case_statement.Rule = "case" + expression + colon; switch_label.Rule = case_statement | "default" + colon; switch_labels.Rule = MakePlusRule(switch_labels, null, switch_label); Frans Kasper, Control Conference 2015
  • 27. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } Frans Kasper, Control Conference 2015
  • 28. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } Frans Kasper, Control Conference 2015
  • 29. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } Frans Kasper, Control Conference 2015
  • 30. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } Frans Kasper, Control Conference 2015
  • 31. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } Frans Kasper, Control Conference 2015
  • 32. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } Frans Kasper, Control Conference 2015
  • 33. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; }
  • 34. CodeConversion- IRONY // IRONY.NET AST Node Example public class SwitchNode : BlockStatement { public override void Init(Irony.Ast.AstContext context, ParseTreeNode treeNode) { // basic initialization base.Init(context, treeNode); // get all AST nodes inside the switch parentheses. var nodes = treeNode.GetMappedChildNodes(); // output C++ code to be generated. CCode = "switch" + "( " + GetCCode(nodes[0]) + ".GetSwitchValue() )"; } } Frans Kasper, Control Conference 2015
  • 35. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } PGMLVar test;
  • 36. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } PGMLVar test; switch ( _instance->Get( var_myMember ).GetSwitchValue() )
  • 37. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } PGMLVar test; switch ( _instance->Get( var_myMember ).GetSwitchValue() ) { case 0:
  • 38. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } PGMLVar test; switch ( _instance->Get( var_myMember ).GetSwitchValue() ) { case 0: _instance->GetInstanceVar< var_x >() = test; break; }
  • 39. CodeConversion- IRONY // Code Sample var test; switch ( myMember ) { case 0: x = test; break; } PGMLVar test; switch ( _instance->Get( var_myMember ).GetSwitchValue() ) { case 0: _instance->GetInstanceVar< var_x >() = test; break; }
  • 40. CodeConversion- C++ • C++ Implementation • GMLVar to emulate variable behavior • Built-in functionality mirrored • Scripts • Execution Flow • Resource Management • Etc. • Compile converted code as usual Frans Kasper, Control Conference 2015
  • 41. CodeConversion • Edge Cases & Pitfalls • Non Orthogonal • Complex Variables • ‘With’ statement Frans Kasper, Control Conference 2015
  • 42. CodeConversion GML // scrScriptTest var test = 0; switch ( argument0 ) { case 0: x = test; // local var y = myMember; // member var break; case "test": t = global.test; // global var w = objTest.test; // object var break; } C++ void scrScriptTest( GMLObjectInstance* _instance, GMLObjectInstance* _other, const PGMLVar& argument0 ) { PGMLVar test = (GMLReal)0; switch ( argument0.GetSwitchValue() ) // returns hash for string types { case 0: _instance->GetInstanceVar< var_x >() = test; _instance->GetInstanceVar< var_y >() = _instance->Get( var_myMember ); break; case 663880771: /* test */ _instance->Get( var_t ) = global.Get( var_test ); _instance->Get( var_w ) = g_objTest.Get( var_test ); break; } } Frans Kasper, Control Conference 2015
  • 43. CodeConversion GML // scrScriptTest var myVar; globalvar test; with ( objTest ) { x = test; y = myVar; } C++ void scrScriptTest( GMLObjectInstance* _instance, GMLObjectInstance* _other ) { GMLInstances& instances = g_objTest.GetInstances(); for ( GMLInstances::iterator it = instances.begin(); it != instances.end(); it++ ) { GMLObjectInstance* current = *it; if ( current->IsDestroyed() ) continue; current->GetInstanceVar< var_x >() = global.Get( var_test ); current->GetInstanceVar< var_y >() = myVar; } } Frans Kasper, Control Conference 2015
  • 44. CodeConversion C++ template< AgUInt32 VarId > class GMLInstanceVar { public: GMLInstanceVar( PGMLVar& refVar, GMLObjectInstance* instance ) : m_refVar( refVar ) { switch ( VarId ) { case var_x: m_refVar = instance->GetX(); // gets current X position break; // etc. } } }; Frans Kasper, Control Conference 2015 template< AgUInt32 VarId > class GMLInstanceVar { public: void OnChanged() { switch ( VarId ) { case var_x: instance->SetX( m_refVar ); // also updates bbox break; // etc } } }; C++
  • 45. Architecture Frans Kasper, Control Conference 2015 • Data Conversion • Code Conversion • Architecture • Pros & Cons
  • 46. Architecture Frans Kasper, Control Conference 2015 Hotline Miami 2
  • 47. Pros & Cons Frans Kasper, Control Conference 2015 • Data Conversion • Code Conversion • Architecture • Pros & Cons
  • 48. Pros & Cons Frans Kasper, Control Conference 2015 • Pros • Full Control, No Dependencies • Better Debugging • Optimization Opportunities • Reusable Technology
  • 49. Pros & Cons Frans Kasper, Control Conference 2015 • Pros • Full Control, No Dependencies • Better Debugging • Optimization Opportunities • Reusable Technology
  • 50. Pros & Cons Frans Kasper, Control Conference 2015 • Pros • Full Control, No Dependencies • Better Debugging • Optimization Opportunities • Reusable Technology
  • 51. Pros & Cons Frans Kasper, Control Conference 2015 • Pros • Full Control, No Dependencies • Better Debugging • Optimization Opportunities • Reusable Technology
  • 52. Pros & Cons Frans Kasper, Control Conference 2015 • Cons • Time Intensive • Never Complete • Parallel Development Problematic • Complexity
  • 53. Pros & Cons Frans Kasper, Control Conference 2015 • Cons • Time Intensive • Never Complete • Parallel Development Problematic • Complexity
  • 54. Pros & Cons Frans Kasper, Control Conference 2015 • Cons • Time Intensive • Never Complete • Parallel Development Problematic • Complexity
  • 55. Pros & Cons Frans Kasper, Control Conference 2015 • Cons • Time Intensive • Never Complete • Parallel Development Problematic • Complexity
  • 56. Takeaways Frans Kasper, Control Conference 2015 • Introduction • Porting at Abstraction Games • SilverWare • Hotline Miami Ports
  • 57. Takeaways • Use the correct tools for the job • Normalize game & engine code Frans Kasper, Control Conference 2015
  • 58. Questions? • http://www.ctrl500.com/tech/ • http://www.enigma-dev.org • https://irony.codeplex.com/ • http://www.abstractiongames.com frans.kasper@abstractiongames.com @snarfk @AbstractionGame Frans Kasper, Control Conference 2015

Editor's Notes

  1. Initially developed for Rogue Legacy in between HLM1 and HLM2.